Input file: standard input Output file: standard output Time limit: 1 seconds Memory limit: 128MB
Description
You are given three integer numbers:k,S(1≤k,S≤1018) and a prime number p(2≤p≤5×106),and we give Ans a definition as following: Ans=∑i=1∏kxi[xi≥1][i=1∑kxi≤S] Assumed that P is a proposition: [P]={10P=trueP=false Please output the Ans
Input
Three integer numbers:k,S(1≤k,S≤1018) and a prime number p(2≤p≤5×106)