Online MIPT programming contest | РУССКИЙ |
<PREV Problem: | NEXT> |
< |
---|
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.
Input#11 |
Output#13 4 5 |
Input#23 |
Output#26 8 10 |
Author:
Statement by Artem Voroztsov, solution, checker & tests by Dmitriy Polischuk
15 September 2007
© acm.mipt DevGroup The page was generated in 210ms |