|Online MIPT programming contest||РУССКИЙ|
Time limit = 2 second(s)A Pythagorean triple consists of three positive integers a, b, and c, such that a2+b2=c2. Your program should calculate N-th Pythagorean triple, considering triples to be sorted in ascending order (lexicographically by c, a, b). Triples (a, b, c) and (b, a, c) are considered to be different.
Input: Single integer number N. 0 < N < 1000000.
Output: Three integers delimited with spaces: a, b, c.
3 4 5
6 8 10
Statement by Artem Voroztsov, solution, checker & tests by Dmitriy Polischuk
15 September 2007
© acm.mipt DevGroup
The page was generated in 180ms