Logo
(追記) (追記ここまで)

28144번 - Allergen Testing 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB280817534.722%

문제

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 $t$ (1ドル \le t \le 10^4$), which is the number of test cases that follow.

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

출력

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

제한

예제 입력 1

1
4 1

예제 출력 1

2

힌트

출처

ICPC > Regionals > North America > North America Championship > North America Championship 2023 A번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /