Solved by 64 users: ...
UserDateAttemptTimeCMSC
mishik12 oct 2007C++2400.60231
mishik13 apr 2008C++2700.57235
DAV10 mar 2010C++2000.13240
DAV10 mar 2010C++1900.12250
DAV10 mar 2010C++1800.10252
velomeloman14 dec 2008C++800.40255
checkil17 dec 2008C++100.39258
velomeloman14 dec 2008C++900.40258
velomeloman13 dec 2008C++700.40260
lutyj23 jan 2008C++200.75260
gchebanov22 oct 2012C++200.06262
mishik10 oct 2007C++1200.52263
mishik10 oct 2007C++1100.48274
pmnox05 feb 2009C++300.68274
arti11 feb 2008C++400.79310
gchebanov23 oct 2012C++300.05319
zmy10 dec 2007C++100.95321
 C++ 46 Kylix 12 Java 3 C 3 FPC 1
>
>
>
>
>
>
>
>
>
>

Pythagorean triples

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 DevGroupThe page was generated in 190ms