Algebra
시간 제한5초메모리 제한1024 MB
x^n + a x + b가 서로 다른 유리근을 정확히 k개 가지도록 하는 정수 쌍 (a,b)의 개수를 |a|,|b| ≤ m 범위에서 센다.
문제
Given three integers , , , find the number of pairs where
- ,
- , i.e., and are integers,
- where be the set of rational roots of the equation , and is the size of . In particular, there exists exactly distinct rational numbers which solve the last equation.
Note: is a rational number if and only if there exists two integers and () where .
입력
The input consists of several test cases terminated by end-of-file. For each test case,
The first line contains three integers , and .
출력
For each test case, output an integer which denotes the number of pairs.
제한
- In each input, the sum of does not exceed .
힌트
For the first test case, only the equation has one rational root.
For the second test case, each of the following equations has two distinct rational roots.