#Lutece1576. Icy Equat1on
Icy Equat1on
Migrated from Lutece 1576 Icy Equat1on
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
In mathematics, an equation is a statement of an equality containing one or more variables. Solving the equation consists of determining which values of the variables make the equality true.
Consider a magic equation as following:
where ``'' means the bitwise xor operation, and both , , are nonnegative integers.
Find the number of the triples which satisfy the above equation in the range of , , .
There are some examples about the bitwise xor operation for binary integers: , , , .
In several programming languages, such as C, C++, Java, a caret () is used to denote the bitwise xor operator.
Input
One line contains three integers , , and .
.
Output
The number of the triples which satisfy the equation modulo .
Samples
1 1 1
4
Note
Both satisfy the equation in the Sample.
Resources
The 15th UESTC Programming Contest Final