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

34584번 - Take It or Double It 다국어

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

문제

You are the host of a street experiment show called TOPC (Take Or Pass Challenge). In the show, you approach people one by one and offer them some money. Each person can either:

  • Take it: Accept the money and end the game.
  • Double it: Reject the money and ask you to double the amount and offer it to the next person.

The game starts with $x$ dollars. You go down the street and meet a random person. You would like to predict in advance what each of them will say — either “take” or “double”.

You have a limited budget of $d$ dollars in your pocket. If, at any point, a person’s decision could result in an amount strictly greater than your available funds $d,ドル you must force the person to say “take it”, regardless of what they wanted to say. Taiwanese people are very kind-hearted, so whenever they have a choice, they would always say “double it” and pass the opportunity to others — unless they are forced to take the money.

Your task is to simulate the game and determine if the person you meet will take the money or double it and give it to the next person.

입력

The input contains two integers $x$ and $d$.

출력

Output a string “take it” or “double it”.

제한

  • 1ドル ≤ x ≤ d ≤ 10^9$

예제 입력 1

123 246

예제 출력 1

double it

예제 입력 2

345 678

예제 출력 2

take it

예제 입력 3

789 101112

예제 출력 3

double it

노트

출처

ICPC > Regionals > Asia Pacific > Taiwan > Taiwan Online Programming Contest > TOPC 2025 A번

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

출처

대학교 대회

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

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