Hello,

Today, I was trying to solve this problem. The Dp behind this problem is not very difficult and is not the tricky part of the problem according to me.

The part that I have completely failed to to understand in this problem is where we are required to calculate ( *Pi* * 1000^{2N}%(1*e*9 + 7)). The author meintions in the problem statement that this (( *Pi* * 1000^{2N}%(1*e*9 + 7))) is guaranteed to be an integer.

Can somebody please provide me a proof of this or just simplify the formula ? I have complete idea about how to approach this problem with doubles without Modulo, but have no idea about doing this with the formula above. How do I calculate the probability * 1000^{2N}%(1*e*9 + 7) ? Help !

If you can calculate probability modulo

Pthen just multiply answer by 1000^{2N}. It can be done by calculating 2^{N}moduloP- 1 and use this theorem calculating answer