1042: Counterfeit Currency Problem [Thinking]
Time Limit: 1 Sec Memory Limit: 128 MBCommits: 200 Resolved: 34 Stats
Topic description
There are fake coins! ! !
Here's the thing, now that pork has risen, but farmers' wages haven't risen, so how can they buy pork without money. Lao Wang went to buy pork, but the change he found contained counterfeit money! ! ! It's a pity that Lao Wang accidentally mixed it into a pile of real coins. It is now known that counterfeit coins weigh less than genuine coins. Give you a scale, please use the fastest time to find out that hateful counterfeit coin.
enter
Enter multiple lines.
The value of each row is the number of coins nn,1≤n≤2301≤n≤230。
Enter 0 to end the program.
output
It takes at least how many times to weigh to find the counterfeit coin.
The output corresponds to the number of input lines.
sample input
3
12
0
Sample output
1
3
...