Solved by 1733 users: ...
UserDateAttemptTimeCMSC
xtender`06 jun 2010`Perl800.0530
Nakilon`05 jun 2010`Ruby800.0237
Nakilon`05 jun 2010`Ruby1100.0237
Nakilon`05 jun 2010`Ruby700.0238
Nakilon`05 jun 2010`Ruby1000.0239
Nakilon`05 jun 2010`Ruby600.0240
sb3ar`13 mar 2008`Ruby1702.8741
xtender`12 apr 2010`Perl500.0543
ravehanker`18 dec 2005`Python1000.0746
El`04 mar 2008`Python100.0747
UlyaNick`19 mar 2009`Ruby100.0349
darkwing`13 dec 2010`Perl3500.0650
darkwing`13 dec 2010`Perl3700.0650
darkwing`13 dec 2010`Perl3800.0650
sir_nuf_nuf`20 sep 2009`Ruby100.0251
darkwing`12 dec 2010`Python2400.0651
darkwing`13 dec 2010`Perl4000.0552
zhuojie`25 dec 2008`Python100.0653
sandler`27 dec 2010`Ruby200.0255
 C++ 841 C 368 FPC 359 Java 89 Kylix 53 Ruby 22 Python 21 Perl 8 Scheme 4 Lua 3
` >  >  >  >  >  >  >  >  >  > `

## Strange Tower

Time limit = 5 second(s)

The strange tower have infinite number of stores and rooms. The first store has one room, next two stores have two rooms each, next three stores have three rooms each, ...

The tower is provided with lift. But inhabitants enconter the following problem: how to get store number and room position on the store given room number?

Input Room number N. 1 ≤ N ≤ 2 000 000 000.

Output Two integers delimited with space: store number and order number from the left.

 Input#1```1 ``` Output#1```1 1 ```
 Input#2```5 ``` Output#2```3 2 ```
 Input#3```8 ``` Output#3```4 3 ```

Author:
Voroztsov Artem

<PREV | Problem set | Search related messages | NEXT>

 © acm.mipt DevGroupThe page was generated in 210ms