Circuit diagram
Each row of n cells connected in series provides emf = nE . The equivalent resistance of each row is also nr. Hence for m rows (parallel connection) the net equivalent resistance becomes (nr)/m.
The emf across the external resistance R is nE.
Hence main current of the circuit
I=nE/(R+nr/m)
if r=0 then I =nE/R