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.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.sql.Array;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Map.Entry;


import java.util.*;

public class a {
	static long mod = 1000000007L;

	 public static void main(String[] args) throws Exception {
	        in = new BufferedReader(new InputStreamReader(System.in));
	        out = new PrintWriter(System.out);
	        sc = new FastScanner(in);
	       HashMap<Integer , HashMap<Integer , ArrayList<Integer>>> map = new HashMap<>();
	       int t =sc.nextInt();
	       while(t-->0) {
	    	int a = sc.nextInt();
	    	int b =sc.nextInt();
	    	int c =sc.nextInt();
	    	int n = sc.nextInt();
	    	int max = Math.max(a, Math.max(b, c));
	    	int req = 3*max - (a+b+c);
	       if(n >= req && (n-req)%3==0) {
	    	   System.out.println("YES");
	       }else {
	    	   System.out.println("NO");
	       }
	       }
	        out.flush();    
	    }
	 public static int max(String a , int lo , int hi , char ch ) {
		 int [] freq = new int[26];
		 int max = 0 ;
		 for(int i =lo ; i<hi;i++) {
			 freq[a.charAt(i)-'a']++;
			 max = Math.max(max, freq[a.charAt(i)-'a']);
		 }
		 return freq[ch-'a'];
	 }
	 public static int good( char ch, String a) {
		 if(a.length()<=1) {
			 if(a.charAt(0)==ch) {
				 return 0;
			 }return 1;
		 }
		 int left = max(a , 0 , a.length()/2 , ch);
		 int right = max(a , a.length()/2 , a.length(),ch) ;
		
		 left = a.length()/2 - left;
		 right = a.length()/2 - right;
		 
		 
		 String c = a.substring(a.length()/2);
		String d = a.substring(0 ,a.length()/2);
		 left += good((char)(ch+1) , c) ;
		 right += good((char)(ch+1), d);
		 return Math.min(left ,right );
	 }
	 
	 
	 
	 static class pair {
		 int ver ;
		 int val;
	 }
	 
	static int[] par;
	static int[] rank;

	static void build(int n) {
		par = new int[n + 1];
		rank = new int[n + 1];
		for (int i = 0; i < n; i++)
			par[i] = i;
	}

	static int find(int u) {
		if (u == par[u])
			return u;
		int v = find(par[u]);
		par[u] = v;
		return v;
	}

	static void union(int u, int v) {
		u = par[u];
		v = par[v];

		if (rank[u] > rank[v]) {
			par[v] = u;
		} else {
			par[u] = v;
			if (rank[u] == rank[v]) {
				rank[v]++;
			}
		}
	}




	public static TreeMap<Integer, TreeSet<Integer>> directed(int n, int m) throws Exception {
		TreeMap<Integer, TreeSet<Integer>> map = new TreeMap<>();
		for (int i = 0; i < n; i++)
			map.put(i, new TreeSet<Integer>());
		for (int i = 0; i < m; i++) {
			int a = sc.nextInt() - 1;
			int b = i;
			map.get(b).add(a);
		}
		return map;
	}

	public static long[] input(int n) throws Exception {

		long[] arr = new long[n];
		for (int i = 0; i < n; i++) {
			arr[i] = sc.nextLong();
		}
		return arr;
	}

	public static long[][] input(int n, int m) throws Exception {

		long[][] arr = new long[n][m];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < m; j++) {

				arr[i][j] = sc.nextInt();
			}
		}
		return arr;
	}

	static BufferedReader in;
	static FastScanner sc;
	static PrintWriter out;

	static class FastScanner {
		BufferedReader in;
		StringTokenizer st;

		public FastScanner(BufferedReader in) {
			this.in = in;
		}

		public String nextToken() throws Exception {
			while (st == null || !st.hasMoreTokens()) {
				st = new StringTokenizer(in.readLine());
			}
			return st.nextToken();
		}

		public int nextInt() throws Exception {
			return Integer.parseInt(nextToken());
		}

		public long nextLong() throws Exception {
			return Long.parseLong(nextToken());
		}

		public double nextDouble() throws Exception {
			return Double.parseDouble(nextToken());
		}
	}
}