Even Palindrome

Xem dạng PDF

Gửi bài giải


Điểm: 0,78 (OI)
Giới hạn thời gian: 1.0s
Giới hạn bộ nhớ: 256M
Input: stdin
Output: stdout

Nguồn bài:
Code Craft 09
Dạng bài
Ngôn ngữ cho phép
C, C++, Go, Java, Kotlin, Pascal, PyPy, Python, Rust, Scratch

Palindrome is a string that has the property of reading the same in either direction (left to right or right to left). You are to determine whether a given string can be expressed as a concatenation of palindromes of even length.

Note: A string can be formed by concatenation of any number of even palindrome strings. Length of string ~\leq 10^{6}~

Input

First line contains ~T~ ~(T < 100)~, the number of test cases. ~T~ lines follow, each containing the string corresponding to that particular test case.

Note:

There might be a new-line character (i.e. '\r' in ~C++)~ at the end of each line. Be careful with your languages.

Output

Output consists of ~T~ lines, one corresponding to each test case. You should output YES if the string can be expressed as concatination of even length palindromes and NO otherwise.

Sample Input

3
madam
aA
aabb

Sample Output

NO
NO
YES

Bình luận

Hãy đọc nội quy trước khi bình luận.


Không có bình luận tại thời điểm này.