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 c1,c2 are the same if and only if there are some point o(may have real value coordinates) and angle
For example, when the points are (1,0),(0,1) and K is 2, coloring c1=(1,2) and c2=(2,1) are the same, because if we rotate the points in c1 180 degrees counterclockwise with the center
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
.
