Problem G
Digits of Unity
At the beginning of the school year, the students in the International College of Paper Cutters (ICPC) choose their student IDs. The students can choose any positive integer less than or equal to some maximum number for their IDs, but no two students can choose the same student ID.
After some deliberation among the ranks, the students
decided they wanted to find some common ground between all
their IDs. In particular, they want to choose their IDs such
that the bitwise AND of all of their student IDs has at least
some minimum number of
The bitwise AND of two integers
This definition generalizes to sets of numbers. The bitwise
AND of a set of integers
Input
The single line of input contains three integers
Output
Output a single integer, which is the number of ways to
choose
Sample Explanation
There are
Sample Input 1 | Sample Output 1 |
---|---|
2 2 10 |
6 |
Sample Input 2 | Sample Output 2 |
---|---|
3 4 14 |
0 |
Sample Input 3 | Sample Output 3 |
---|---|
2 1 100000 |
910073387 |