logo AlgoBeat OnlineJudge
登录 注册

#215957. [TOPC 2025] Take It or Double It

内存限制:512 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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 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 dollars in your pocket. If, at any point, a person’s decision could result in an amount strictly greater than your available funds , 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 and .

输出格式

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

样例

样例输入 1

123 456

样例输出 1

double it

样例输入 2

345 678

样例输出 2

take it

样例输入 3

789 101112

样例输出 3

double it

数据范围与提示

Technical Specification