Solved by 64 users: ...
UserDateAttemptTimeCMSC
mishik`12 oct 2007`C++2400.60231
mishik`13 apr 2008`C++2700.57235
DAV`10 mar 2010`C++2000.13240
DAV`10 mar 2010`C++1900.12250
DAV`10 mar 2010`C++1800.10252
velomeloman`14 dec 2008`C++800.40255
checkil`17 dec 2008`C++100.39258
velomeloman`14 dec 2008`C++900.40258
velomeloman`13 dec 2008`C++700.40260
lutyj`23 jan 2008`C++200.75260
gchebanov`22 oct 2012`C++200.06262
mishik`10 oct 2007`C++1200.52263
mishik`10 oct 2007`C++1100.48274
pmnox`05 feb 2009`C++300.68274
VladimirChelnokov`14 sep 2007`C++301.34295
VladimirChelnokov`14 sep 2007`C++201.23301
arti`11 feb 2008`C++400.79310
VladimirChelnokov`14 sep 2007`C++800.96312
gchebanov`23 oct 2012`C++300.05319
zmy`10 dec 2007`C++100.95321
VladimirChelnokov`14 sep 2007`C++600.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#1```1 ``` Output#1```3 4 5 ```
 Input#2```3 ``` Output#2```6 8 10 ```

Author:
Statement by Artem Voroztsov, solution, checker & tests by Dmitriy Polischuk
15 September 2007

 © acm.mipt DevGroupThe page was generated in 210ms