#C3726. Palindromic Pair Checker

    ID: 47185 Type: Default 1000ms 256MiB

Palindromic Pair Checker

Palindromic Pair Checker

Problem Statement

You are given a string s of even length. Your task is to determine whether it can be split into two segments of equal length, s1 and s2, such that the reverse of s2 is exactly equal to s1. In other words, you need to check if:

\( s_1 = s_2^R \)

If the condition holds, print YES; otherwise, print NO.

Note: Input strings will have an even number of characters.

inputFormat

The first line contains a single integer T indicating the number of test cases.

Each of the next T lines contains a string s of even length.

Example:

3
abccba
abcdef
noppon

outputFormat

For each test case, output a single line containing YES if the string can be split into two segments where the reversed second segment equals the first segment, otherwise output NO.

Example:

YES
NO
YES
## sample
3
abccba
abcdef
noppon
YES

NO YES

</p>