<PREV Problem:
NEXT>
Solved by 1733 users: ...
UserDateAttemptTimeCMSC
xtender06 jun 2010Perl800.0530 
Nakilon05 jun 2010Ruby800.0237 
Nakilon05 jun 2010Ruby1100.0237 
Nakilon05 jun 2010Ruby700.0238 
Nakilon05 jun 2010Ruby1000.0239 
Nakilon05 jun 2010Ruby600.0240 
sb3ar13 mar 2008Ruby1702.8741 
xtender12 apr 2010Perl500.0543 
ravehanker18 dec 2005Python1000.0746 
El04 mar 2008Python100.0747 
UlyaNick19 mar 2009Ruby100.0349 
darkwing13 dec 2010Perl3500.0650 
darkwing13 dec 2010Perl3700.0650 
darkwing13 dec 2010Perl3800.0650 
sir_nuf_nuf20 sep 2009Ruby100.0251 
darkwing12 dec 2010Python2400.0651 
darkwing13 dec 2010Perl4000.0552 
zhuojie25 dec 2008Python100.0653 
sandler27 dec 2010Ruby200.0255 
Languages
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 DevGroup
The page was generated in 200ms

SW soft NIX
ID = 34.204.191.0