ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Сборники > Фёдор Меньшиков. Тренировки > задача:


024. 50372 - Number Quadruplets

Гость
• Вопросы к жюри (1)

Задачи сборника

• 002. 50554 - Fuqia e n-t e m (2)
• 004. 50424 - Area
• 004. 50522 - Multiplication Table - 2
• 012. 50352 - Selling Cows
• 017. 50537 - esreveR Triangle
• 018. 50491 - Brokers
• 018. 50787 - Expected Value
• 020. 50485 - Center of gravity of a ...
• 024. 50372 - Number Quadruplets
• 025- 2013-Nov-01. 50328 - How far ...
• 026. 50487 - Radius of Inscribed Circle
• 027. Albanian Airlines
• 028. 50483 - Group Total
• 033. 50588 - Perpunimi i nje liste n...
• 035. 50573 - Numri dhe shuma
• 044. 50597 - Vizatojme Diamante
• 058. 50574 - Numrat Trekendesh

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 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 = 32
  • 22 + 42 + 42 = 62
  • 22 + 32 + 62 = 72
  • 12 + 42 + 82 = 92
  • 32 + 62 + 62 = 92
  • 42 + 42 + 72 = 92

Для отправки решений необходимо выполнить вход.

www.contester.ru