Allergen Testing

아직 제출이 없습니다시간 제한1초메모리 제한2048 MB

문제

You are in a chemistry class, and you are working with some compounds, exactly one of which you are allergic to. You have a fixed number of days to figure out which compound it is. You set up a number of sites on your arm for testing. On each day, you do the following exactly once:

  1. Apply each compound to some (possibly empty) subset of sites on your arm. You can apply more than one compound to the same site.
  2. Wait and see which sites demonstrate an allergic reaction.

A site demonstrates an allergic reaction if and only if the compound you are allergic to is applied to that site. If a site demonstrates an allergic reaction, it cannot be used on future days.

Compute the minimum number of sites you'll need on your arm to guarantee that you can determine exactly which compound you are allergic to within the given number of days.

입력

The first line of input contains a single integer tt (1t1041 \le t \le 10^4), which is the number of test cases that follow.

Each of the next tt lines contains two integers nn and dd (1n,d10181 \le n,d \le 10^{18}) describing a test case, where nn is the number of compounds and dd is the number of days.

출력

Output tt lines. On each line output a single integer, which is the minimum number of sites on your arm necessary to discover which of the nn compounds is the allergen within dd days for that test case. Output the answers to the test cases in the order they appear in the input.