시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 128 MB | 8 | 3 | 3 | 37.500% |
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:
A zero on a line by itself indicates the end of input and should not be processed.
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.
2 6666 5555 1 1234 0
BUSTED TRUE