Submit | All submissions | Best solutions | Back to list |
TOHU2 - Tohu again |
Tohu was very tired during the preparation for entrance exams at Moscow State University and Ksjuchi decided to joke on him (of course to cheer). She said him that she is magician and she can read his thoughts. To prove that she's prepared some tables of characters where every character have an unique number more than 0 but less than 100. She shows one of tables to him and asked to make a two-digit integer, subtract from this number the sum of its digits and concentrate on symbol with this number from the table.
Then she calls the character of which he thinks.
Magic, is not it? =)
But Ksjuchi is preparing for the exam in philosophy now, and while she was drawing these tables noxious Socrates mixed up some of the cells. Now Ksjuchi need to know what tables she can use to surprise Tohu. Help her.
Input
First line : number of tests T<=1000
Test:
99 lines where every have a type:
i ch where i = 1..99 included and "ch" - 'a'..'z' or 'A'..'Z'
Output
Print YES if Ksjuchi might uniquely define symbol that Tohu put forth.
Otherwise print NO
Example
Input: 1 1 k 2 q 3 J 4 Q 5 P 6 R 7 e 8 G 9 L 10 c 11 g 12 T 13 w 14 v 15 p 16 P 17 X 18 X 19 p 20 I 21 X 22 z 23 L 24 u 25 K 26 F 27 t 28 H 29 Q 30 r 31 V 32 e 33 F 34 V 35 D 36 u 37 c 38 n 39 z 40 w 41 Z 42 K 43 Y 44 j 45 Y 46 M 47 u 48 U 49 H 50 i 51 n 52 S 53 k 54 q 55 W 56 o 57 L 58 J 59 O 60 S 61 Z 62 G 63 m 64 T 65 P 66 k 67 i 68 b 69 J 70 a 71 E 72 g 73 O 74 P 75 M 76 s 77 M 78 A 79 O 80 P 81 g 82 h 83 V 84 U 85 M 86 G 87 Y 88 u 89 D 90 F 91 h 92 q 93 h 94 a 95 l 96 P 97 d 98 T 99 w Output: NO
Ksjuchi is not a magician. Really.
Added by: | Egor |
Date: | 2011-06-19 |
Time limit: | 1s |
Source limit: | 10000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | own problem |
hide comments
|
||||||
2013-07-01 05:59:18 Rishabh Dugar
just case sensitive thats it,,costed 3 WA |
||||||
2013-04-18 12:34:47 Amr
silly :/ |
||||||
2013-04-14 21:55:04 mohammed magdy mohammed abdalla
solving this problem makes me very happy ^_^ |
||||||
2013-02-01 16:20:10 Yo Yo Honey Singh
tricky n v.simple... :) |
||||||
2013-01-19 20:14:30 pranjuldb
take care of the space between the number and the symbol awesome problem but a tricky also Last edit: 2013-01-19 20:15:17 |
||||||
2013-01-01 13:23:36 Man Mohan Mishra
awesome problem !! |
||||||
2012-11-19 16:14:04 Ajey Golsangi
The problem reduces to the answer to "when is the output YES ?". Get the answer to this and you will get AC. |
||||||
2012-04-06 11:36:30 Karthick Raja
Nice One :D |
||||||
2011-10-15 20:17:04 sri
test case for yes?? |
||||||
2011-09-13 12:01:39 Islam metwally ッ
when it outputs yes ?? |