For each element of array how much number to be added to make it divisible by K
for j in range ( n ) : NEW_LINE INDENT if ( ( arr [ j ] % k ) != 0 ) : NEW_LINE INDENT b2 . append ( k - ( arr [ j ] % k ) ) NEW_LINE DEDENT else : NEW_LINE INDENT b2 . append ( 0 ) NEW_LINE DEDENT DEDENT c = 0 NEW_LINE mini = float ( ' inf ' ) NEW_LINE suml = 0 NEW_LINE sumr = 0 NEW_LINE index = - 1 NEW_LINE