Problem: Polycarp has three sisters: Alice, Barbara, and Cerene. They're collecting coins. Currently, Alice has a coins, Barbara has b coins and Cerene has c coins. Recently Polycarp has returned from the trip around the world and brought n coins.

He wants to distribute all these n coins between his sisters in such a way that the number of coins Alice has is equal to the number of coins Barbara has and is equal to the number of coins Cerene has. In other words, if Polycarp gives A coins to Alice, B coins to Barbara and C coins to Cerene (A+B+C=n), then a + A = b + B = c + C.

Note that A, B or C (the number of coins Polycarp gives to Alice, Barbara and Cerene correspondingly) can be 0.

Your task is to find out if it is possible to distribute all n coins between sisters in a way described above.

You have to answer t independent test cases.

Input

The first line of the input contains one integer t (1 ≤ t ≤ 10^4) — the number of test cases.

The next t lines describe test cases. Each test case is given on a new line and consists of four space-separated integers a, b, c and n (1 ≤ a, b, c, n ≤ 10^8) — the number of coins Alice has, the number of coins Barbara has, the number of coins Cerene has and the number of coins Polycarp has.

Output

For each test case, print "YES" if Polycarp can distribute all n coins between his sisters and "NO" otherwise.

Example

Input


5
5 3 2 8
100 101 102 105
3 2 1 100000000
10 20 15 14
101 101 101 3


Output


YES
YES
NO
NO
YES

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;
import java.math.BigInteger; 
import java.lang.Object;


public class Main {
    
    
   static class sort implements Comparator<double[]>
   {
        public int compare(double[] a,double[] b)
        {
            //if(a[0] == b[0]) return a[1]-b[1];
           if(a[0] < b[0]) return -1;
           else if(a[0] > b[0]) return 1;
           return 0;
        }
   }
   static class sort1 implements Comparator<double[]>
   {
        public int compare(double[] a,double[] b)
        {
            //if(a[0] == b[0]) return a[1]-b[1];
           if(a[1] < b[1]) return -1;
           else if(a[1] > b[1]) return 1;
           return 0;
        }
   }
   public static String[] F(BufferedReader bf) throws Exception
    {
        return (bf.readLine().split(" "));
    }
    
   public static void pr(PrintWriter out,Object o)
   {
      
    out.println(o.toString());out.flush();
    
   }
   public static void prW(PrintWriter out,Object o)
   {
      
    out.print(o.toString());out.flush();
    
   }
   public static int intIn(String st)
   {
      return Integer.parseInt(st);
   }
   
   
    
    public static void pr(Object o)
    {
        System.out.println(o.toString());
    }
    public static void prW(Object o)
    {
        System.out.print(o.toString());
    }
    
   
    public static int inInt(String s)
    {
        return Integer.parseInt(s);
    }
    public static long in(String s)
    {
        return Long.parseLong(s);
    }

    
    static long pow(long x, long y, long p)
      {
        long res = 1; // Initialize result
     
        x = x % p; // Update x if it is more than or
        // equal to p
     
        if (x == 0)
          return 0l; // In case x is divisible by p;
     
        while (y > 0)
        {
     
          // If y is odd, multiply x with result
          if ((y & 1) != 0)
            res = (res * x) % p;
     
          // y must be even now
          y = y >> 1; // y = y/2
          x = (x * x) % p;
        }
        return res;
      }
      static long pow1(long x, long y, long p)
      {

        if(y==1) return (x%p);

        long res = 1; // Initialize result
     
        res = (pow(x,y,p));
        long d = (pow1(res,y-1,p));
        return (d%p);
      }
      static long gcd(long a, long b)
        {
          if (b == 0)
            return a;
          return gcd(b, a % b); 
        }
        static int gcd(int a, int b,int o)
        {
          if (b == 0)
            return a;
          return gcd(b, a % b,o); 
        }
    static int[] toIntArray(String[] m) 
    { 
        int[] p=new int[m.length];
        for(int o=0;o<m.length;o++)
        {
            p[o]= inInt(m[o]);
        }
        return p;
    }
    static double[] toDArray(String[] m) 
    { 
        double[] p=new double[m.length];
        for(int o=0;o<m.length;o++)
        {
            p[o]= Double.parseDouble(m[o]);
        }
        return p;
    }
    static long[] toLArray(String[] m) 
    { 
       long[] p=new long[m.length];
        for(int o=0;o<m.length;o++)
        {
            p[o]= in(m[o]);
        }
        return p;
    }
    
    static int[][] di={{0,1},{1,0},{0,-1},{-1,0}};
    public static double F(double[] x,double[] w)
    {
        double d1,d2;
        double S=0.00;
        for(double dp : w) S += dp;
        int k = 0;
        double sum = S - w[0]; // sum is the total weight of all `x[i] > x[k]`

        while(sum > S/2)
        {
            ++k;
            sum -= w[k];
        }
        d1=x[k];
        return d1;
       /* k = w.length-1;
       sum = S - w[k]; // sum is the total weight of all `x[i] > x[k]`

        while(sum > S/2)
        {
            --k;
            sum -= w[k];
        }
        d2=x[k];
        return new double[]{d1,d2};*/
    }
    public static double G(double[] x,double[] w)
    {
        double S=0.00;
        for(double dp : w) S += dp;
        int k = 0;
        double sum = S - w[0]; // sum is the total weight of all `x[i] > x[k]`

        while(sum > S/2)
        {
            ++k;
            sum -= w[k];
        }
        if((k+1)<w.length)
        return x[k+1];return x[k];
    }
    public static boolean F(int a,int b,Boolean[][] dp,char[] a1,char[] a2)
    {
       // a=Math.min(a,a1.length);
        //b=Math.min(b,a2.length);
        if(a>=a1.length && b>=a2.length) 
        {
            return true;
        }
        /*if(a>=a1.length || b>=a2.length)
        {
            boolean bol;
           return dp[a][b];
        }*/
        if(dp[a][b] != null) return dp[a][b];boolean bol;
        if(a1[a] != '*' && a2[b] != '*')
        {
            if(a1[a]==a2[b])
            {
                bol=F(a+1,b+1,dp,a1,a2);
            }
            else bol=false;
            dp[a][b]=bol;return bol;
        }
        else
        {
            boolean bo = false;
            if(a1[a] == '*')
            {
                bo = bo || (F(a+1,b,dp,a1,a2));
                for(int x=1;x<=4 && (b+x)<=a2.length;x++)
                {
                    bo = bo || (F(a+1,b+x,dp,a1,a2));
                }
            }
            if(a2[b] == '*')
            {
                bo = bo || (F(a,b+1,dp,a1,a2));
                for(int x=1;x<=4 && (a+x)<=a1.length;x++)
                {
                    bo = bo || (F(a+x,b+1,dp,a1,a2));
                }
            }
            dp[a][b] = bo;
        }

        return dp[a][b];
    }
    public static long F(int i,Long[] dp,long[] arr)
    {
        if(i>=arr.length)
        {
            return 0l;
        }
        if(dp[i] != null) return dp[i];
        long ans=10000000000000000l;
        long or = 1l;
        for(int j=i;j<arr.length;j++)
        {
            or = (or | (arr[j]));
            ans=Math.min(ans,(or^(F(j+1,dp,arr))));
        }
        dp[i]=ans;return ans;
    }
    static long mod=1000000000+7l;
    public static long F(int n,int k,Long[] dp)
    {
        long res=0l;
        if(n==1 || n==0) return 1l;
        if(n<0) return 0l;
        if(dp[n] != null)  return dp[n];

        long i=0l;
        for(int o=1;o<=k;o++)
        {
            i = (i+F(n-o,k,dp)%mod)%mod;
        }
        dp[n]=i;return i;
    }
    public static void main (String[] args) throws Exception {
        
        BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(System.out);;;
        
        //int[] map=new int[1000001];
      
        int yy=Integer.parseInt(bf.readLine());
        //sieve(); 
        for(int w=0;w<yy;w++)
        {

            
            //MedianFinder mf = new MedianFinder(5);
            String[] xlp = bf.readLine().split(" ");;;;
            //String st = bf.readLine();
           int n,k,t,x;//boolean bol=false;
           int m;//long a,b,c;
            n=inInt(xlp[0]);m=inInt(xlp[1]);k=inInt(xlp[2]);t=inInt(xlp[3]);
            int tot = (n+m+k+t);
            if((tot%3) != 0)
            {
                pr(out,"NO");continue;
            }
            tot = (tot/3);
            if(n<=tot && m<=tot && k<=tot)
            {
                pr(out,"YES");
            }
            else pr(out,"NO");

           
            

    }
    out.close();
}}


/*



8
5 5
1 1 1 1 1
5 10 20 50 100
10 10
10 10 10 10 10 10 10 10 10 10
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
4 4
4 3 2 1
100 1000 100000 1000000000
10 1
1 1 1 1 1 1 1 1 1 1
999999999
1 10
5
2 3 9 30 566 1337 31337 70775 111111 413413
5 5
1 2 3 4 5
10 40 90 160 250
9 9
5 3 4 2 4 3 5 4 3
4 6 9 10 11 9999 1000000000 1000000000 1000000000
3 3
3 2 3
100 200 400


100663319,201326611,402653189,805306457,1610612741
Kickstart
 String rp;
            rp = "Case #"+(w+1)+": "+(n-ans)+" ";
static int[][] dir={{0,1},{1,0},{-1,0},{0,-1}};

static class SegmentTreeRMQ 
    { 
    int st[]; 
    int minVal(int x, int y) { 
        return (x > y) ? x : y; 
    } 
  
    
    int getMid(int s, int e) { 
        return s + (e - s) / 2; 
    } 
  
    
    int RMQUtil(int ss, int se, int qs, int qe, int index) 
    { 
        
        if (qs <= ss && qe >= se) 
            return st[index]; 
  
        // If segment of this node is outside the given range 
        if (se < qs || ss > qe) 
            return Integer.MIN_VALUE; 
  
        // If a part of this segment overlaps with the given range 
        int mid = getMid(ss, se); 
        return minVal(RMQUtil(ss, mid, qs, qe, 2 * index + 1), 
                RMQUtil(mid + 1, se, qs, qe, 2 * index + 2)); 
    } 
  
    // Return minimum of elements in range from index qs (query 
    // start) to qe (query end).  It mainly uses RMQUtil() 
    int RMQ(int n, int qs, int qe) 
    { 
        // Check for erroneous input values 
        
  
        return RMQUtil(0, n - 1, qs, qe, 0); 
    } 
  
    // A recursive function that constructs Segment Tree for 
    // array[ss..se]. si is index of current node in segment tree st 
    int constructSTUtil(int arr[], int ss, int se, int si) 
    { 
        // If there is one element in array, store it in current 
        //  node of segment tree and return 
        if (ss == se) { 
            st[si] = arr[ss]; 
            return arr[ss]; 
        } 
  
        // If there are more than one elements, then recur for left and 
        // right subtrees and store the minimum of two values in this node 
        int mid = getMid(ss, se); 
        st[si] = minVal(constructSTUtil(arr, ss, mid, si * 2 + 1), 
                constructSTUtil(arr, mid + 1, se, si * 2 + 2)); 
        return st[si]; 
    } 
  
    
    void con(int arr[]) 
    { 
        // Allocate memory for segment tree 
  
        //Height of segment tree 
        int n = (arr.length);
        int x = (int) (Math.ceil(Math.log(n) / Math.log(2))); 
  
        //Maximum size of segment tree 
        int max_size = 2 * (int) Math.pow(2, x) - 1; 
        st = new int[max_size]; // allocate memory 
  
        // Fill the allocated memory st 
        constructSTUtil(arr, 0, n - 1, 0); 
    }
    }
     static class DSU {
    
    int[] p;int[] sz;int op;int c;;
    int[] last;
    public void G(int n)
    {
        last=new int[n];
        p=new int[n];
        sz=new int[n];c=n;
        op=n;
        for(int h=0;h<n;h++)
        {
            sz[h]=1;p[h]=h;
            last[h]=h;
        }
    }
    public int find(int x)
    {
        int y=x;
        while(x!=p[x]) x=p[x];
        while(y!=p[y])
        {
            int tem=p[y];
            p[y]=x;y=tem;
        }
        return p[y];
    }
    public void union(int a,int b)
    {
        int x,y;
        x=find(a);y=find(b);
        if(x==y) return;
        if(sz[x]>sz[y])
        {
            p[y] = x;
            sz[x]+=sz[y];
            last[x]=Math.max(last[x],last[y]);
        }
        else
        {
            p[x]=y;sz[y]+=sz[x];
            last[y]=Math.max(last[y],last[x]);
        }
        c--;
        
    }}

    static long pow(long x, long y, long p)
      {
        long res = 1; // Initialize result
     
        x = x % p; // Update x if it is more than or
        // equal to p
     
        if (x == 0)
          return 0l; // In case x is divisible by p;
     
        while (y > 0)
        {
     
          // If y is odd, multiply x with result
          if ((y & 1) != 0)
            res = (res * x) % p;
     
          // y must be even now
          y = y >> 1; // y = y/2
          x = (x * x) % p;
        }
        return res;
      }
      static long gcd(long a, long b)
        {
          if (b == 0)
            return a;
          return gcd(b, a % b); 
        }
        static int gcd(int a, int b,int o)
        {
          if (b == 0)
            return a;
          return gcd(b, a % b,o); 
        }


*/