#C2312. Unique Caves Visit

    ID: 45615 Type: Default 1000ms 256MiB

Unique Caves Visit

Unique Caves Visit

Dave is exploring a network of caves. Starting from cave number (k) and given a group with (H) hikers, the number of unique caves he can visit is determined as follows. First, round (H) to the nearest integer, then compute (M = \lceil \log_2(\text{round}(H)) \rceil). The answer is given by the formula (\text{Answer} = M - k + 1).

For example, if (k = 3) and (H = 15.6), rounding (15.6) gives 16 and (\log_2(16) = 4). Thus (M = 4) and the answer is (4 - 3 + 1 = 2).

inputFormat

The input consists of two lines. The first line contains an integer (k), the starting cave number. The second line contains a floating-point number (H), representing the number of hikers.

outputFormat

Output a single integer that represents the number of unique caves Dave can visit.## sample

3
15.6
2