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.io.IOException;
  import java.io.InputStream;
  import java.util.Arrays;
  import java.util.InputMismatchException;
  
  public class CF2012A {
  
      public static void main(String[] args) {
          StringBuilder output = new StringBuilder();
          int testcase = ni();
          for (int t = 1; t <= testcase; t++) {
              String s = ns();
              if (s.length() % 2 == 1) {
                  output.append("NO").append("\n");
                  continue;
              }
              int j = s.length() / 2;
              int i = 0;
              boolean flag = true;
              while (j < s.length()) {
                  if (s.charAt(i) != s.charAt(j)) {
                      flag = false;
                      output.append("NO").append("\n");
                      break;
                  }
                  i++;
                  j++;
              }
              if (flag) {
                  output.append("YES").append("\n");
              }
          }
          System.out.println(output);
      }
  
      static InputStream is = System.in;
      static byte[] inbuf = new byte[1 << 24];
      static int lenbuf = 0, ptrbuf = 0;
  
      static int readByte() {
          if (lenbuf == -1)
              throw new InputMismatchException();
          if (ptrbuf >= lenbuf) {
              ptrbuf = 0;
              try {
                  lenbuf = is.read(inbuf);
              } catch (IOException e) {
                  throw new InputMismatchException();
              }
              if (lenbuf <= 0)
                  return -1;
          }
          return inbuf[ptrbuf++];
      }
  
      static boolean isSpaceChar(int c) {
          return !(c >= 33 && c <= 126);
      }
  
      static int skip() {
          int b;
          while ((b = readByte()) != -1 && isSpaceChar(b)) ;
          return b;
      }
  
      static double nd() {
          return Double.parseDouble(ns());
      }
  
      static char nc() {
          return (char) skip();
      }
  
      static String ns() {
          int b = skip();
          StringBuilder sb = new StringBuilder();
          while (!(isSpaceChar(b))) {
              sb.appendCodePoint(b);
              b = readByte();
          }
          return sb.toString();
      }
  
      static char[] ns(int n) {
          char[] buf = new char[n];
          int b = skip(), p = 0;
          while (p < n && !(isSpaceChar(b))) {
              buf[p++] = (char) b;
              b = readByte();
          }
          return n == p ? buf : Arrays.copyOf(buf, p);
      }
  
      static int ni() {
          int num = 0, b;
          boolean minus = false;
          while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
              ;
          if (b == '-') {
              minus = true;
              b = readByte();
          }
          while (true) {
              if (b >= '0' && b <= '9') {
                  num = num * 10 + (b - '0');
              } else {
                  return minus ? -num : num;
              }
              b = readByte();
          }
      }
  
      static long nl() {
          long num = 0;
          int b;
          boolean minus = false;
          while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
              ;
          if (b == '-') {
              minus = true;
              b = readByte();
          }
          while (true) {
              if (b >= '0' && b <= '9') {
                  num = num * 10 + (b - '0');
              } else {
                  return minus ? -num : num;
              }
              b = readByte();
          }
      }
  }
  