Pro.ID10280 TitleMyth Busters Title链接http://10.20.2.8/oj/exercise/problem?problem_id=10280 AC0 Submit0 Ratio- 时间&空间限制描述Every train carriage operated by CityRail of Sydney has a unique ID number of four digits. A not so uncommon myth amongst local school pupils is that every ID number can be manipulated by permuting the digits, using brackets and using arithmetic operations from the set {'*' , '/', '+' , '-'} to calculate the number 10. Your task is to check the validity of this myth for the carriages operated by CityRail of Sydney and for train carriages from other cities whose ID numbers were collected. Reminder: The operation '/' refers to integer division. Most of you already know it, but here are two examples: result of 5/2 is 2 and of 2/5 is 0. 输入The input consists of many test cases. The description of each test case consists of: • an integer N (1 ≤ N ≤ 1000), on a line by itself, which indicates the number of IDs collected from one city, and • N lines that contain a four-digit number each. A zero on a line by itself indicates the end of input and should not be processed. 输出Description Every train carriage operated by CityRail of Sydney has a unique ID number of four digits. A not so uncommon myth amongst local school pupils is that every ID number can be manipulated by permuting the digits, using brackets and using arithmetic operations from the set {'*' , '/', '+' , '-'} to calculate the number 10. Your task is to check the validity of this myth for the carriages operated by CityRail of Sydney and for train carriages from other cities whose ID numbers were collected. Reminder: The operation '/' refers to integer division. Most of you already know it, but here are two examples: result of 5/2 is 2 and of 2/5 is 0. Input The input consists of many test cases. The description of each test case consists of: • an integer N (1 ≤ N ≤ 1000), on a line by itself, which indicates the number of IDs collected from one city, and • N lines that contain a four-digit number each. A zero on a line by itself indicates the end of input and should not be processed. Output For each test case print the conclusion of your investigation as TRUE or BUSTED as shown in "Output for the Sample Input" below. Print TRUE if this myth is correct for all carriage ID numbers for that city. Otherwise, BUSTED is to be printed. Sample Input 2 Sample Output BUSTED Source 样例输入2 样例输出BUSTED 作者 |