#P12265. 『STA - R9』真空介电常数
『STA - R9』真空介电常数
Background
Please note: the background of the problem may not be related to the problem.
One day, Xiao Zhou was studying a very fast sieve. He was very unhappy with the notation of the Zhouge sieve’s complexity . Why does an algorithm that does not need to use a bitset have a division in its complexity?
Xiao Zhou suddenly came up with a good idea. Since the order of the logarithm function is lower than that of power functions, let denote an infinitesimal, and then we can make ! Thus, Xiao Zhou excitedly thought, we can directly let correspond to some specific infinitesimal , and then the complexity of the Zhouge sieve can be written as !
So pretty!
At this moment, a classmate named whk came over.
“Why do you people in informatics still need the vacuum permittivity?”
Problem Description
Given positive integers , with . Compute
$$\sum_{k = 1}^{n-1} \sin^{-2m} \left(\frac{ks}{n}\pi\right)$$modulo .
It can be proven that the answer must be a rational number. For how to take a rational number modulo, please refer to P2613 Rational Number Modulo.
Input Format
A single line with three positive integers .
Output Format
A single line with one integer, representing the answer modulo .
4 3 1
17
11451 19198 11451419198
473735219
Hint
| Score | ||||
|---|---|---|---|---|
For all testdata, it is guaranteed that and .
Hint: contestants should pay attention to the impact of constant factors in the complexity on the program’s running efficiency.
Translated by ChatGPT 5