description: You are given four integer values a, b, c and m.
  
  Check if there exists a string that contains: 
  
    * a letters 'A'; 
    * b letters 'B'; 
    * c letters 'C'; 
    * no other letters; 
    * exactly m pairs of adjacent equal letters (exactly m such positions i that the i-th letter is equal to the (i+1)-th one). 
  
  Input
  
  The first line contains a single integer t (1 ≤ t ≤ 10^4) — the number of testcases.
  
  Each of the next t lines contains the description of the testcase — four integers a, b, c and m (1 ≤ a, b, c ≤ 10^8; 0 ≤ m ≤ 10^8).
  
  Output
  
  For each testcase print "YES" if there exists a string that satisfies all the requirements. Print "NO" if there are no such strings.
  
  You may print every letter in any case you want (so, for example, the strings yEs, yes, Yes and YES will all be recognized as positive answer).
  
  Example
  
  Input
  
  
  3
  2 2 1 0
  1 1 1 1
  1 2 3 2
  
  
  Output
  
  
  YES
  NO
  YES
  
  Note
  
  In the first testcase strings "ABCAB" or "BCABA" satisfy the requirements. There exist other possible strings.
  
  In the second testcase there's no way to put adjacent equal letters if there's no letter that appears at least twice.
  
  In the third testcase string "CABBCC" satisfies the requirements. There exist other possible strings.
solution: import java.io.*;
  import java.util.*;
  
  public class C {
      static final Reader sc = new Reader();
      static boolean prime[];
      static int M = 1_000_000_007;
  
      public static void main(String[] args) throws IOException {
          try {
              int t = sc.nextInt();
              StringBuilder ans =new StringBuilder();
              while (t-- > 0) {
                  //Solve here
                  int a=sc.nextInt();
                  int b=sc.nextInt();
                  int c=sc.nextInt();
                  int m=sc.nextInt();
                  if((a-1)>b+c+m || (b-1)>a+c+m || (c-1)>a+b+m)
                      System.out.println("NO");
                  else if(m<=(a+b+c-3)) System.out.println("YES");
                  else System.out.println("NO");
              }
          } catch (Exception e) {
              return;
          }
  
      }
  
  
      static int[] arrayIn(int n) throws IOException {
          int arr[] = new int[n];
          for (int i = 0; i < n; i++) {
              arr[i] = sc.nextInt();
          }
          return arr;
      }
  
      public static class Pairs implements Comparable<Pairs> {
          int value, index;
  
          Pairs(int value, int index) {
              this.value = value;
              this.index = index;
          }
  
          public int compareTo(Pairs p) {
              return Integer.compare(this.value, p.value);
          }
      }
  
      static final Random random = new Random();
  
      static void ruffleSort(int arr[]) {
          int n = arr.length;
          for (int i = 0; i < n; i++) {
              int j = random.nextInt(n), temp = arr[j];
              arr[j] = arr[i];
              arr[i] = temp;
          }
          Arrays.sort(arr);
      }
  
      static long nCk(int n, int k) {
          return (modMult(fact(n), fastexp(modMult(fact(n - k), fact(k)), M - 2)));
      }
  
      static long fact(long n) {
  
          long fact = 1;
          for (int i = 1; i <= n; i++) {
              fact = modMult(fact, i);
          }
          return fact % M;
      }
  
      static long modMult(long a, long b) {
          return a * b % M;
      }
  
      static long fastexp(long x, int y) {
          if (y == 1) return x;
  
          long ans = fastexp(x, y / 2);
          if (y % 2 == 0) return modMult(ans, ans);
          else return modMult(ans, modMult(ans, x));
      }
  
      static void sieveOfEratosthenes(int n) {
          prime = new boolean[n + 1];
          for (int i = 0; i <= n; i++)
              prime[i] = true;
          prime[0] = false;
          if (1 <= n)
              prime[1] = false;
          for (int p = 2; p * p <= n; p++) {
  
              if (prime[p] == true) {
  
                  for (int i = p * p; i <= n; i += p)
                      prime[i] = false;
              }
          }
      }
  
      static class Reader {
          final private int BUFFER_SIZE = 1 << 16;
          private DataInputStream din;
          private byte[] buffer;
          private int bufferPointer, bytesRead;
  
          public Reader() {
              din = new DataInputStream(System.in);
              buffer = new byte[BUFFER_SIZE];
              bufferPointer = bytesRead = 0;
          }
  
          public Reader(String file_name) throws IOException {
              din = new DataInputStream(new FileInputStream(file_name));
              buffer = new byte[BUFFER_SIZE];
              bufferPointer = bytesRead = 0;
          }
  
          public String readLine() throws IOException {
              byte[] buf = new byte[64]; // line length
              int cnt = 0, c;
              while ((c = read()) != -1) {
                  if (c == '\n')
                      break;
                  buf[cnt++] = (byte) c;
              }
              return new String(buf, 0, cnt);
          }
  
          public int nextInt() throws IOException {
              int ret = 0;
              byte c = read();
              while (c <= ' ')
                  c = read();
              boolean neg = (c == '-');
              if (neg)
                  c = read();
              do {
                  ret = ret * 10 + c - '0';
              } while ((c = read()) >= '0' && c <= '9');
  
              if (neg)
                  return -ret;
              return ret;
          }
  
          public long nextLong() throws IOException {
              long ret = 0;
              byte c = read();
              while (c <= ' ')
                  c = read();
              boolean neg = (c == '-');
              if (neg)
                  c = read();
              do {
                  ret = ret * 10 + c - '0';
              }
              while ((c = read()) >= '0' && c <= '9');
              if (neg)
                  return -ret;
              return ret;
          }
  
          public double nextDouble() throws IOException {
              double ret = 0, div = 1;
              byte c = read();
              while (c <= ' ')
                  c = read();
              boolean neg = (c == '-');
              if (neg)
                  c = read();
  
              do {
                  ret = ret * 10 + c - '0';
              }
              while ((c = read()) >= '0' && c <= '9');
  
              if (c == '.') {
                  while ((c = read()) >= '0' && c <= '9') {
                      ret += (c - '0') / (div *= 10);
                  }
              }
  
              if (neg)
                  return -ret;
              return ret;
          }
  
          private void fillBuffer() throws IOException {
              bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
              if (bytesRead == -1)
                  buffer[0] = -1;
          }
  
          private byte read() throws IOException {
              if (bufferPointer == bytesRead)
                  fillBuffer();
              return buffer[bufferPointer++];
          }
  
          public void close() throws IOException {
              if (din == null)
                  return;
              din.close();
          }
      }
  }
  