EZ Programming Contest #1 |
---|
Закончено |
You are given two strings $$$s$$$ and $$$t$$$. An operation consists of the following:
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) — the number of test cases.
The first line of each test case contains a single integer $$$n$$$ ($$$2 \leq n \leq 2000$$$) — the length of $$$s$$$ and $$$t$$$.
The next two lines contain the strings $$$s$$$ and $$$t$$$ of length $$$n$$$, consisting of lowercase English letters. Additional constraint on the input: $$$s \neq t$$$.
For each test case, output YES if it is possible to turn $$$s$$$ into $$$t$$$ using these operations. Otherwise, output NO. You can print each letter of YES and NO in any case (upper or lower).
2 3 qrs orz 4 ezpc icpc
YES NO
In the first test case, we can pick the characters q and s in qrs, turn q into o, and turn s into z. The resulting string is orz.
In the second test case, it can be shown that it is impossible to turn $$$s$$$ into $$$t$$$.
Название |
---|