HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Beginners > problem:


51030 - Number of Right Triangles

Guest
• Review clarifications (1)

Volume problems

• 51029 - Buy Three Items
• 51034 - Area of 3 Shapes
• 51032 - Triangle Property
• 51033 - Sum of the series
• 51027 - Download Percentage
• 51028 - Isosceles Triangles
• 50799 - OSHEE Electric Bill
• 51031 - Convert from Hex to Dec
• 51030 - Number of Right Triangles
• 005. 50797 - Nr of Missing Guests
• 007. 50280 - Division
• 028. 50521 - Pound to Grams
• 034. 50502 - Welcome Andi - 1
• 042. 50798 - Passing the course
• 045. 50391 - Cinema Tickets
• 048. 50403 - Number of Chairs
• 052. 50503 - Welcome Andi - 2

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.
Question by Ibrahim Mesecan.

Number of Right Triangles

Question: If a, b and c are the sides of a triangle, a right triangle complies the formula c2 = a2 + b2. You are given the sides of three triangles, How many of them are right triangles?

Input specification: You will be given 3 integers in three lines. (a, b and c) where 0 ≤ (a, b and c) ≤ 1 million.

Output specification: Show one number, the number of right triangles.

Sample Input I
3 4 5
12 5 13
7 10 15
Sample Input II
3 19 19
6 11 14
9 12 15
Sample Output I
2
Sample Output II
1

Explanation: for the first sample:52 = 32 + 42 and 132 = 122 + 52 comply but the other number triple does not comply the pythagorean theorem. For the second sample, only one number triple (152 = 122 + 92) complies the pythagorean theorem.

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

www.contester.ru