#P6788. 「EZEC-3」四月樱花
「EZEC-3」四月樱花
Description
In April, when sakura are in full bloom, Muxii looked at the sakura falling all over the sky and asked ZZH beside him:
"Exactly how many sakura petals fall in this April?"
ZZH answered: "The number of fallen sakura, , and time satisfy the following relation:
where denotes the number of divisors of ."
But as a liberal arts student beginner, Muxii obviously could not clearly know the exact value, so he had to keep asking ZZH for the answer to this question.
Since the value may be very large, you only need to tell Muxii the result of the answer modulo for ZZH.
Input Format
Two positive integers and , representing the time asked by Muxii and the modulus, respectively.
Output Format
Output a positive integer , representing the number of fallen sakura. Output the answer modulo .
4 998244353
648735108
10 1000000007
872041698
Hint
"Sample 1 Explanation"
By direct substitution, the answer is . Since the modular inverse of modulo is , the final answer is .
"Constraints and Notes"
The testdata guarantees that in the fraction in lowest terms of the answer, the denominator does not contain or any multiple of .
For all testdata, it is guaranteed that , , and is a prime number. |Subtask ID||Score| |:-:|:-:|:-:| |||| |||| |||| |||| |||| |||| ||||
Note: This problem uses bundled judging, meaning you must pass all test points of a subtask to receive the score for that subtask.
Translated by ChatGPT 5
京公网安备 11011102002149号