Inverted Tower
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
The Babylonians decided to build an amazing tower - expanding to the top and containing an infinite number of floors and rooms. It is arranged as follows - on the first floor there is one room, then there are two floors each with two rooms, then there are three floors, each with three rooms and so on.
This tower was decided to equip with an elevator - and here is the problem: given room number you need to determine the floor and position of the room on that floor from the left.
Input
Room number n (1 ≤ n ≤ 2 * 10^9
).
Output
Print two space separated integers: the floor and the position of the room on that floor from the left.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 802
Acceptance rate 40%