| Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб. By Arban Uka.
 
 
 Number Quadruplets
 Assume that we have the following relation: 
a2 + b2 + c2 =
d2 Question: 
Find the number of unique quadruplets
of (a, b, c, d) that satisfy the
above relation for the given d.
Note:  the following three 
quadruplets are assumed to be the same. Thus,
you count only one.12+22+22 = 32
 22+12+22 = 32
 22+22+12 = 32
 
 Input specification  You will be given just one integer d where
1 ≤ d ≤ 100) and 1 ≤ (a,b,c) ≤ d.
 Output specification  Show the number of unique quadruplets.
 
| Sample Input I | Sample Input II |  | 
 10  
 | 
 20 
 |  
| Sample Output I | Sample Output II |  
|  6 
 |  22 
 |  Explanation  There are six unique number quadruplets until ten.
 
12 + 22 + 22 = 3222 + 42 + 42 = 6222 + 32 + 62 = 7212 + 42 + 82 = 9232 + 62 + 62 = 9242 + 42 + 72 = 92 Для отправки решений необходимо выполнить вход.
 
 
 |