#P117. [KSC001C] A problem about mice
[KSC001C] A problem about mice
Source
This problem is adapted from Long Long OJ. All rights reserved.
Problem Description
There are bottles of liquid, where exactly one contains poison and the rest are saline solution.
One day, you accidentally mixed them up. The lab professor was furious and ordered you to identify the poisoned bottle within hours.
Of course, you cannot test the liquids yourself. The only thing you can do is request a certain number of lab mice.
Each hour, a mouse can test a batch of liquids (note: the batch size can be ). If the batch contains the poisoned liquid, the mouse will die immediately; otherwise, it will survive.
To minimize harm to the mice, your task is to determine the minimum number of mice required to identify the poisoned bottle within the given time.
Input Format
A single line containing two integers and .
Output Format
A single integer , representing the number of mice you need to send.
Samples
4 1
2
500 24
2
Sample 1 Explanation
Clearly, you can have the first mouse drink from bottles and , and the second mouse drink from bottles and . This setup uniquely identifies the poisoned bottle.
Sample 2 Explanation
It can be proven that no solution with fewer than mice exists.
Data Range
| Test Case | Special Property | |
|---|---|---|
| AB | ||
| B | ||
| C | ||
| B | ||
| C | ||
| A | ||
| None |
- Special Property A:
- Special Property B:
- Special Property C:
For of the data, .