#P17238. 『STA - R10』Petal Dance
『STA - R10』Petal Dance
Problem Description
Aqua gives you two positive integers . For each integer , you need to compute
The answer should be taken modulo .
Input Format
One line contains two positive integers .
Output Format
Since the output would be too large, you only need to output the value of $\displaystyle\bigoplus_{k = 1}^n \left( k \cdot (a_k\bmod m) \right)$ (note where the modulo is applied).
10 998244353
7854
1000000 998244353
666900907572623
Hint
Explanation for Sample 1: $\{a_k\} = \{100, 175, 202, 265, 244, 347, 214, 369, 340, 427\}$.
This problem uses bundled testdata.
| Subtask | Score | Special Property |
|---|---|---|
| 1 | 5 | |
| 2 | ||
| 3 | 15 | |
| 4 | ||
| 5 | 20 | |
| 6 | 40 | None |
Constraints for all testdata: , .
Translated by ChatGPT 5