luogu#P3791. 普通数学题
普通数学题
Background
One day, zzq had no problems to set. So he casually wrote an expression to compute $\sum_{i=0}^n \sum_{j=0}^m i \operatorname{xor} j \operatorname{xor} x$, where denotes bitwise XOR.
zzy thought this was easy, so he casually added a function: $\sum_{i=0}^n \sum_{j=0}^m d(i \operatorname{xor} j \operatorname{xor} x)$, where denotes bitwise XOR and denotes the number of divisors of . Note that .
Now zzq could not solve it, so he wrote a brute-force generator to produce testdata and threw this problem to you.
Problem Description
Given three integers , compute $\sum_{i=0}^n \sum_{j=0}^m d(i \operatorname{xor} j \operatorname{xor} x)$, where denotes bitwise XOR and denotes the number of divisors of .
Since the answer can be large, output the result modulo .
Input Format
One line with three integers .
Output Format
Output the answer modulo .
0 2 233
14
123 234 345
205761
Hint
For of the testdata, .
For of the testdata, .
For of the testdata, .
For of the testdata, .
Translated by ChatGPT 5