description: A string is called square if it is some string written twice in a row. For example, the strings "aa", "abcabc", "abab" and "baabaa" are square. But the strings "aaa", "abaaab" and "abcdabc" are not square.
  
  For a given string s determine if it is square.
  
  Input
  
  The first line of input data contains an integer t (1 ≤ t ≤ 100) —the number of test cases.
  
  This is followed by t lines, each containing a description of one test case. The given strings consist only of lowercase Latin letters and have lengths between 1 and 100 inclusive.
  
  Output
  
  For each test case, output on a separate line:
  
    * YES if the string in the corresponding test case is square, 
    * NO otherwise. 
  
  
  
  You can output YES and NO in any case (for example, strings yEs, yes, Yes and YES will be recognized as a positive response).
  
  Example
  
  Input
  
  
  10
  a
  aa
  aaa
  aaaa
  abab
  abcabc
  abacaba
  xxyy
  xyyx
  xyxy
  
  
  Output
  
  
  NO
  YES
  NO
  YES
  YES
  YES
  NO
  NO
  NO
  YES
solution: import java.util.*;
  
  public class DynamicProgramming {
  
      public static Scanner in = new Scanner(System.in);
  
      public static void main(String[] args) {
          boolean singleTestCase = false;
          int testCases = singleTestCase ? 1 : in.nextInt();
          while(testCases > 0) {
              solve();
              testCases--;
          }
      }
  
      public static void solve() {
          String s = in.next();
          if(s.length() % 2 == 0 && s.substring(0, s.length() / 2).equals(s.substring(s.length() / 2, s.length()))) {
              System.out.println("YES");
          }
          else System.out.println("NO");
      }
  
  
  
  
  
  
  
  
  
      ////////////////////////////////////////////////////////////
  
      public static void print(String s) {
          System.out.println(s);
      }
  
      public static int[] nextIntArray(int length) {
          int[] arr = new int[length];
          for(int i = 0; i < length; i++) {
              arr[i] = in.nextInt();
          }
          return arr;
      }
  
      public static int nextInt() {
          return in.nextInt();
      }
  
      public static int gcd(int n1, int n2) {
          if(n2 == 0) {
              return n1;
          }
          return gcd(n2, n1 % n2);
      }
  
      public static void merge(int[] arr, int l, int m, int r) {
          //Find sizes of two subarrays to be merged
          int n1 = m - l + 1;
          int n2 = r - m;
          int leftSubarray[] = new int[n1];
          int rightSubarray[] = new int[n2];
          //Copy data to temp arrays
          for (int i = 0; i < n1; ++i)
              leftSubarray[i] = arr[l + i];
          for (int j = 0; j < n2; ++j)
              rightSubarray[j] = arr[m + 1 + j];
          /* Merge the temp arrays */
          int i = 0, j = 0;
          //Initial index of merged subarray array
          int k = l;
          while (i < n1 && j < n2) {
              if (leftSubarray[i] <= rightSubarray[j]) {
                  arr[k] = leftSubarray[i];
                  i++;
              }
              else {
                  arr[k] = rightSubarray[j];
                  j++;
              }
              k++;
          }
          while (i < n1) {
              arr[k] = leftSubarray[i];
              i++;
              k++;
          }
          while (j < n2) {
              arr[k] = rightSubarray[j];
              j++;
              k++;
          }
      }
  
      public static void sort(int[] arr, int l, int r) {
          if (l < r) {
              int m = l+ (r - l) / 2;
              sort(arr, l, m);
              sort(arr, m + 1, r);
              merge(arr, l, m, r);
          }
      }
  
      public static void sort(int[] arr) {
          sort(arr, 0, arr.length - 1);
      }
  
      public static void arrPrint(int[] arr, int l, int r) {
          for(int i = l; i <= r; i++) {
              System.out.print(arr[i] + " ");
          }
          System.out.println();
      }
  
      public static void arrPrint(int[] arr) {
          arrPrint(arr, 0, arr.length - 1);
      }
  }
  