#K68012. Palindromic Painting IDs

    ID: 32770 Type: Default 1000ms 256MiB

Palindromic Painting IDs

Palindromic Painting IDs

You are given multiple test cases. In each test case, you are provided with a number of painting IDs, each represented as a string. Your task is to find and output the IDs that are palindromic. A string is considered a palindrome if it reads the same backwards as forwards (i.e., \( s = s^R \)).

If no palindromic IDs exist in a test case, output exactly No palindromic IDs. For each test case, print the results on a new line. The IDs in the same test case should be printed in the order they appear in the input and separated by a single space.

Input Format: The first line contains an integer \( T \), the number of test cases. For each test case, the first line contains an integer \( N \) denoting the number of painting IDs, followed by \( N \) lines each containing one painting ID.

Output Format: For each test case, output a single line containing the palindromic painting IDs separated by a space. If there is no palindromic ID in a test case, output No palindromic IDs.

inputFormat

The input begins with an integer \( T \) representing the number of test cases. Each test case is described as follows:

  • The first line of each test case contains an integer \( N \), the number of painting IDs.
  • The following \( N \) lines each contain a single string representing a painting ID.

Input is read from stdin.

outputFormat

For each test case, output a single line:

  • If there is at least one palindromic painting ID, print all such IDs, separated by a single space.
  • If there are no palindromic IDs, print No palindromic IDs.

Output is written to stdout.

## sample
1
1
12321
12321

</p>