Update the vectors such that v [ i ] will contain all the elements that give remainder as i when divided by k
for ( int i = 0 ; i < n ; i ++ ) { int t = arr [ i ] % k ; v . get ( t ) . add ( arr [ i ] ) ; }