National Olympiad in Informatics, China, 2001
Given an
where:
Assume that the unknowns will satisfy
Input Specification
The first line of input contains the integer
The second line of input contains the integer
Lines 3 to
Output Specification
Output one integer - the number of integer solutions that solve the equation.
Sample Input
Copy
3
150
1 2
-1 2
1 2
Sample Output
Copy
178
Constraints
- The number of solutions will be less than
. - The exponents
in this problem will each be a positive integer.
Problem translated to English by .
Comments