To improve Rikka's math, Yuta designs a simple game which requires a lot of calculating. The game has several steps:
1. At first, the terminal chooses n points with integer coordinates in the two-dimensional Cartesian coordinate system and an integer K. And then, the terminal shows them to Rikka.
2. Rikka needs to color the n points using K different colors. Different points may have the same color, and some colors may not be used.
3. Rikka needs to count the number of different colorings.
Two colorings c
1,c
2 are the same if and only if there are some point o(may have real value coordinates) and angle

which satisfies if we rotate the n points in c
1 
degrees counterclockwise with the center o, the result will look exactly the same (including colors and positions) as c
2.
For example, when the points are (1,0),(0,1) and K is 2, coloring c
1=(1,2) and c
2=(2,1) are the same, because if we rotate the points in c
1 180 degrees counterclockwise with the center
)
, the result will be exactly the same as c
2. And in this case, there are 3 different colorings: (1,1),(1,2),(2,2).
After playing this game several times, Rikka finds that the terminal always chooses points from a fixed point set P. So there are exactly

different games (all P's subsets except

).
Let f(S,K) be the answer of the game when the point set chosen by the terminal is S and the number of colors is K. Now, given P and K, Rikka wants to calculate
)
.