Take one more example :-A and B both want to kill C and for the purpose both were hidden at two different places .A and B neither ever met nor known to each other .They both fired to C for killing to him . Here they both will be prosecuted with section 34IPC as the intention was same .No matter that by whoes fire c was killed .
Big difference between sec 34 sec 149 IPC and that's why both can not be apply along together .
One more example we take:;-A,B,C,D,E&F Hides at different places to kill the person "x" . All of them provide help to "A" to give the exact location of "x" by mobile phones and other means .By the fire of "A" , Mr."x" got killed . Here all the five will be prosecuted u/s 149 alongwith the others .