Seive function
Can any one solve this
C++ code N^(f(X)) mod M
f(X) is defined as product of primes upto X
1<=N,M<=10^9
1<=X<=10^6