vector to store all the prime factors along with their number of occurrence in factorization of k
vector < pair < int , int > > ans ; for ( int i = 2 ; k != 1 ; i ++ ) { if ( k % i == 0 ) { int count = 0 ; while ( k % i == 0 ) { k = k / i ; count ++ ; } ans . push_back ( make_pair ( i , count ) ) ; } } return ans ; }