Codeforces Round 183 (Div. 2)
A
Pythagorean Theorem II
Codeforces
1200
原题
←B →
翻译中…

In mathematics, the Pythagorean theorem — is a relation in Euclidean geometry among the three sides of a right-angled triangle. In terms of areas, it states:

翻译中…

In any right-angled triangle, the area of the square whose side is the hypotenuse (the side opposite the right angle) is equal to the sum of the areas of the squares whose sides are the two legs (the two sides that meet at a right angle).

翻译中…

The theorem can be written as an equation relating the lengths of the sides $*a*$, $*b*$ and $*c*$, often called the Pythagorean equation:

翻译中…

$*a*^{2} + *b*^{2} = *c*^{2}$

翻译中…

where $*c*$ represents the length of the hypotenuse, and $*a*$ and $*b*$ represent the lengths of the other two sides.

翻译中…

image

翻译中…

Given $*n*$, your task is to count how many right-angled triangles with side-lengths $*a*$, $*b*$ and $*c*$ that satisfied an inequality $1 ≤ *a* ≤ *b* ≤ *c* ≤ *n*$.

翻译中…

Input

翻译中…

The only line contains one integer $*n* (1 ≤ *n* ≤ 10^{4})$ as we mentioned above.

翻译中…

Output

翻译中…

Print a single integer — the answer to the problem.

翻译中…

样例

Input #1
5
Output #1
1
InputCopy OutputCopy
Input #2
74
Output #2
35
InputCopy OutputCopy
题目信息
题号
304A
时间限制
3 s
内存限制
256 MB
标签
暴力
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。