Compute the desired sum for all given cell indexes
for i in range ( 0 , n ) : NEW_LINE INDENT r0 , c0 = arr [ i ] . r , arr [ i ] . c NEW_LINE print ( Sum - row [ r0 ] - col [ c0 ] + mat [ r0 ] [ c0 ] ) NEW_LINE DEDENT