H-on-K A Incorporation
All submissions for this problem are available.
Our hero elohb has started a new business in the name of H-on-K A Inc. like all new business he wants a huge opening and most media to cover his opening
ceremony. He books a large theatre and then divides them into multiple view zones for people to watch and the opening ceremony.
Now, since this is a huge function elohb doesn't wants any problem he realises he should reserve privileges for VIP's in his function so he creates special
9 view zones for the VIPs each containing AC's, better lightning facility,better serving,better food.
He further wants to divide the VIP's into 2 categories VIP1 and VIP2(more important) and he doesn't wants the VIP's to realise this so he uses a special nummeration of there seat numbers.
In case of VIP1 numbering of the tickets, the seats in the 1st view zone are numbered 1-4, the seats in the 2nd view zone are numbered 5-8, and so on.
In case of VIP2 numbering of the tickets, every seat's number consists of two digits. The 1st digit is the no of the view zone and the second digit is the number of the seat within that view zone. view zones are numbered 1-9, and the 4 seats within each view zone are numbered 1, 3, 4, 6 (in the same order as in the VIP1 numbering of the tickets).
Now here comes the problem during printing the press person forgot to take care of special numbering of the tickets he prints the tickets in unknown type,
but fortunately he prints all in the same type. So, you can easily convert the number into correct one. Since, this can be a long process he decides to convert them all into VIP2.Unfortunately, this news spread like a wildfire in the thieves and they want to enjoy the luxury for free they print themselves
tickets almost identical to the real ones. so they also join the theatre rooms :(.
Your task is to identify a set of given tickets into VIP1 and VIP2 and convert both numberings into VIP2.Also since in some cases the input can be valid for both VIP1 and VIP2 you can't decide you simply say that the input is "UNCLASSIFIABLE" in case you find that the seat numbers are not valid you say its a thief and print "THIEF".
- 1 ≤ test ≤ 1000
- 1 ≤ N ≤ 1000
First line contains T no. of test cases. The following lines contain a number N. The next line follows with N seperated ticket numbers.
For each test case print the converted ticket types.
16 Output: 56
|Time Limit:||0.102941 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, CLOJ, FS|
Fetching successful submissions