HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Geometry > problem:


50362 - Pythagorean Numbers

Guest
• Discussion of problem (2)

Section problems

• 50237 - Is it the same color?
• 50422 - Area and Perimeter of diffe...
• 50399 - Mobile Base Station
• 50397 - The Number of Points in a ...
• 50349 - Area of a Triangle
• 50348 - Area and Perimeter of a Rec...
• 50665 - Intersecting rectangles
• 50668 - Triangle
• 50362 - Pythagorean Numbers
• 50354 - Intersecting Rectangles
• 50660 - Triangle and the point
• 50666 - The card and envelope
• Problem 2
• 50663 - Lights
• 50667 - Intersecting Line Segments

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared by Ibrahim Mesecan. Difficulty Beta

Pythagorean Number Triples

Write a program that is going to show the number of Pythagorean Number Triples that are less than or equal to the given number n.
For example if n=20 then the Pythagorean Number Triples are:
  5 3 4
  10 6 8
  13 5 12
  15 9 12
  17 8 15
  20 12 16
giving the result 6.
Note: After counting (5 3 4), (5 4 3) is not count because essantially they are the same triples.

Input specification
You will be given an integer number (n) where 1 ≤ n ≤ 1000

Output specification
Show the number of Pythagorean Number Triples.

Sample Input I
  20
Sample Input II
  100
Sample Output I
  6
Sample Output II
  52


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

www.contester.ru