description: The only difference between this problem and D2 is that you don't have to provide the way to construct the answer in this problem, but you have to do it in D2.
  
  There's a table of n × m cells (n rows and m columns). The value of n ⋅ m is even.
  
  A domino is a figure that consists of two cells having a common side. It may be horizontal (one of the cells is to the right of the other) or vertical (one of the cells is above the other).
  
  You need to find out whether it is possible to place nm/2 dominoes on the table so that exactly k of them are horizontal and all the other dominoes are vertical. The dominoes cannot overlap and must fill the whole table.
  
  Input
  
  The first line contains one integer t (1 ≤ t ≤ 10) — the number of test cases. Then t test cases follow.
  
  Each test case consists of a single line. The line contains three integers n, m, k (1 ≤ n,m ≤ 100, 0 ≤ k ≤ nm/2, n ⋅ m is even) — the number of rows, columns and horizontal dominoes, respectively.
  
  Output
  
  For each test case output "YES", if it is possible to place dominoes in the desired way, or "NO" otherwise.
  
  You may print each letter in any case (YES, yes, Yes will all be recognized as positive answer, NO, no and nO will all be recognized as negative answer).
  
  Example
  
  Input
  
  
  8
  4 4 2
  2 3 0
  3 2 3
  1 2 0
  2 4 2
  5 2 2
  2 17 16
  2 1 1
  
  
  Output
  
  
  YES
  YES
  YES
  NO
  YES
  NO
  YES
  NO
solution: import java.io.*;
  import java.util.*;
  
  public class A734D {
      public static void main(String[] args) {
          JS scan = new JS();
          int t = scan.nextInt();
          loop:while(t-->0){
              int n = scan.nextInt();
              int m = scan.nextInt();
              int k = scan.nextInt();
              if(k==0) {
                  System.out.println(n%2==0?"YES":"NO");
              }
              else if (n % 2 == 1) {
                  //need to fill up an odd number of rows
                  //ah but u can also make small squares and then fill up the rest with verticals...
                  boolean bad = false;
                  if(k<m/2){
                      bad = true;
                  }
                  k-=m/2;
                  if(k%2!=0)bad = true;
                  System.out.println(bad?"NO":"YES");
              } else if (m % 2 == 1) {
                  //need to have 1 left over in each row... which i think this does
                  //ah but u can also just make small 2x2 squares and fill out the rest with verticals
                  boolean one = k%2==0;
                  boolean two = k<=n*(m-1)/2;
                  System.out.println(one && two?"YES":"NO");
              }
              else System.out.println(k%2==0?"YES":"NO");
  
          }
      }
      static class JS {
          public int BS = 1 << 16;
          public char NC = (char) 0;
          byte[] buf = new byte[BS];
          int bId = 0, size = 0;
          char c = NC;
          double num = 1;
          BufferedInputStream in;
  
          public JS() {
              in = new BufferedInputStream(System.in, BS);
          }
  
          public JS(String s) throws FileNotFoundException {
              in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
          }
  
          public char nextChar() {
              while (bId == size) {
                  try {
                      size = in.read(buf);
                  } catch (Exception e) {
                      return NC;
                  }
                  if (size == -1) return NC;
                  bId = 0;
              }
              return (char) buf[bId++];
          }
  
          public int nextInt() {
              return (int) nextLong();
          }
  
          public long nextLong() {
              num = 1;
              boolean neg = false;
              if (c == NC) c = nextChar();
              for (; (c < '0' || c > '9'); c = nextChar()) {
                  if (c == '-') neg = true;
              }
              long res = 0;
              for (; c >= '0' && c <= '9'; c = nextChar()) {
                  res = (res << 3) + (res << 1) + c - '0';
                  num *= 10;
              }
              return neg ? -res : res;
          }
  
          public double nextDouble() {
              double cur = nextLong();
              return c != '.' ? cur : cur + nextLong() / num;
          }
  
          public String next() {
              StringBuilder res = new StringBuilder();
              while (c <= 32) c = nextChar();
              while (c > 32) {
                  res.append(c);
                  c = nextChar();
              }
              return res.toString();
          }
  
          public String nextLine() {
              StringBuilder res = new StringBuilder();
              while (c <= 32) c = nextChar();
              while (c != '\n') {
                  res.append(c);
                  c = nextChar();
              }
              return res.toString();
          }
  
          public boolean hasNext() {
              if (c > 32) return true;
              while (true) {
                  c = nextChar();
                  if (c == NC) return false;
                  else if (c > 32) return true;
              }
          }
      }
  }
  