Set the 0 th row of the matrix with c primes from 0 , 0 to 0 , c - 1
void set_primes ( map < int , map < int , int > > & mp , map < int , map < int , int > > & hash , int c ) { int count = 0 ; for ( int i = 2 ; count < c ; i ++ ) { if ( is_Prime ( i ) ) { mp [ 0 ] [ count ++ ] = i ; hash [ 0 ] [ count - 1 ] = 1 ; } } }