#t46. 勾股数计数
勾股数计数
Counting Pythagorean Triples
Problem Description
Pythagorean triples are a very interesting mathematical notion. Three positive integers satisfying with form a Pythagorean triple . Can you write a program to count how many such Pythagorean triples satisfy ?
Input Format
One line containing a positive integer . It is guaranteed that .
Output Format
Output one line containing an integer , the number of Pythagorean triples satisfying the condition.
Sample Input
Sample Input 1
5
Sample Input 2
13
Sample Output
Sample Output 1
1
Sample Output 2
3
Sample Explanation
For the first sample, the input is , meaning we need to find all Pythagorean triples with . By enumerating all possible combinations of satisfying and , only works, since . So the output is .
Constraints