Weighing
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
n balls are given. n – 1 of them have the same weight, and one is heavier. Find the minimum number of weighings required to determine which ball is heavier using a two pan balance. Weighing operation is described as follows: the same amount of balls is placed on each of the two pans. If one pan outweigh the other, the heavy ball lies on the first one. If the pans in balance, the heavy ball is out of pans. After each weighing the decision is made which balls will participate in the next weighting.
Input
One integer n (2 ≤ n ≤ 10^9
).
Output
Print the minimum number of weighings to find the heavy ball.
Examples
Input #1
Answer #1
Input #2
Answer #2
Input #3
Answer #3
Submissions 7K
Acceptance rate 39%