| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 128 MB | 440 | 308 | 278 | 70.558% |
A letter bank is a word such that all the letters of one letter bank can be used as many times as desired (at least once each) to make a new word. For example, ‘IMPS’ is a bank of ‘MISSISSIPPI.’
Given two words α and β, you are to write a program for deciding whether α is a bank of β. Assume that the first word α has no repeated letters. Every word consists only of capital Roman letters: A, B, …, Z, and no blank.
Your program is to read from standard input. The input consists of T (1 ≤ T ≤ 20) test cases. The number T of test case is given in the first line of the input. For each test case, two words are given in one line. There is a single space between the first word and the second word. And each word has length at most 80.
Your program is to write a standard output. Print exactly one line for each test case. For each test case, print “YES” if the first word is a bank of the second word. Otherwise, print “NO”.
4 IMPS MISSISSIPPI BLUE BLUE CNT COCONUT IPC PC
YES YES NO NO
ICPC > Regionals > Asia Pacific > Korea > Nationwide Internet Competition > Seoul Nationalwide Internet Competition 2007 A번