#P8158. 「PMOI-5」分力
「PMOI-5」分力
Description
There is a circle with radius and center at on the Cartesian plane.
On this circle, red points are marked at equal distances, and one of the points lies on the positive -axis.
NaCly_Fish is also at . She randomly chooses a red point with equal probability and pushes toward it with a force of .
Let the components of her pushing force on the and axes be and . She wants to know the -th central moments of these two random variables.
For a random variable , its -th central moment is defined as , where is the expected value of .
It can be proved that the answer must be a rational number, so output the answer modulo .
Input Format
Input one line with two positive integers .
Output Format
Output one line with two integers, representing the -th central moments of and , respectively.
2 2
1 0
5 15
815216641 0
114 514
636199406 569855248
Hint
[Explanation for Sample 1]
The second central moment is the variance. Since she can only push in the positive or negative direction, is always zero, so its variance is also zero. can be with equal probability, so the variance is .
[Constraints]
This problem uses bundled testdata.
- Subtask 1 (7 pts): ;
- Subtask 2 (14 pts): ;
- Subtask 3 (19 pts): ;
- Subtask 4 (23 pts): ;
- Subtask 5 (37 pts): no special restrictions.
For of the testdata, and .
Translated by ChatGPT 5
京公网安备 11011102002149号