luogu#P5691. [NOI2001] 方程的解数
[NOI2001] 方程的解数
Problem Description
Given an -variable higher-degree equation:
where are the unknowns, are the coefficients, and are the exponents. All numbers in the equation are integers.
Assume the unknowns satisfy . Find the number of integer solutions to this equation.
Input Format
The first line contains a positive integer , the number of unknowns.
The second line contains a positive integer .
The next lines each contain two integers .
Output Format
Output one line with one integer, the number of solutions of the equation.
3
150
1 2
-1 2
1 2
178
Hint
【Constraints】
For of the testdata, , , and
The answer does not exceed , and .
Translated by ChatGPT 5