Score | |
---|---|
Problem A | 462 |
Problem B | 693 |
Problem C | 1155 |
Problem D | 1386 |
Problem E | 1848 |
Problem F1 | 1386 |
Problem F2 | 924 |
Successful hack | 100 |
Unsuccessful hack | -50 |
Unsuccessful submission | -50 |
Resubmission | -50 |
Mihai plans to watch a movie. He only likes palindromic movies, so he wants to skip some (possibly zero) scenes to make the remaining parts of the movie palindromic.
You are given a list
A subsequence of
Can you help Mihai check if there is at least one awesome subsequence of
A palindrome is a string that reads the same backward as forward, for example strings "z", "aaa", "aba", "abccba" are palindromes, but strings "codeforces", "reality", "ab" are not.
A sequence
The first line of the input contains a single integer
The first line of each test case contains a single integer
Then follows
It is guaranteed that the sum of
For each test case, print "YES" if there is an awesome subsequence of
6 5 zx ab cc zx ba 2 ab bad 4 co def orc es 3 a b c 3 ab cd cba 2 ab ab
YES NO NO YES YES NO
In the first test case, an awesome subsequence of
Name | |||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
No items |