function return p - 1 ( = x argument ) as x * 2 ^ e , where x will be odd sending e as reference because updation is needed in actual e
int convertx2e ( int x , int & e ) { e = 0 ; while ( x % 2 == 0 ) { x /= 2 ; e ++ ; } return x ; }