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.*;
public class Solution {
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        private FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;

        }

    }
    static class Node{
        int key;
        int depth;
        Node left, right;
        public Node(int value){
            this.key=value;
            left=right=null;
        }
        public Node(int value, int d){
            this.key=value;
            this.depth=d;
            left=right=null;
        }
    }
    static class MaxHeap{
        private int[] heap;
        private int size;
        private int maxSize;
        public MaxHeap(int a){
            this.maxSize=a;
            heap= new int[this.maxSize+1];
            this.size=0;
        }
        private int parent(int pos){
            return pos/2;
        }
        private int rightChild(int pos){
            return 2*pos+2;
        }
        private int leftChild(int pos){
            return 2*pos+1;
        }
        private boolean isLeaf(int pos){
            if(pos>=size/2 && pos<=size){
                return  true;
            }
            return false;
        }
        private void swap(int fpos, int spos){
            int temp=heap[fpos];
            heap[fpos]=heap[spos];
            heap[spos]=temp;
        }
        private void maxHeapify(int pos){
            if(isLeaf(pos)){
                return;
            }
            if(heap[pos]<heap[leftChild(pos)]|| heap[pos]<heap[rightChild(pos)]){
                if(heap[leftChild(pos)]>heap[rightChild(pos)]){
                    swap(pos,leftChild(pos));
                    maxHeapify(leftChild(pos));
                }
                else{
                    swap(pos,rightChild(pos));
                    maxHeapify(rightChild(pos));
                }
            }
        }
        public void insert(int value){
            heap[++size]= value;
            int current= size;
            while(heap[current]>heap[parent(current)]){
                swap(current, parent(current));
                current=parent(current);
            }
        }
        public int maxValue(){
            int max=heap[1];
            heap[1]=heap[size];
            size--;
            maxHeapify(1);
            return max;
        }

        public void print(){
            for(int i=0; i<size; i++){
                System.out.println(heap[i]);
            }
        }
    }
    static class Pair<U, V> {
        private final U first;       // first field of a Pair
        private final V second;      // second field of a Pair

        // Constructs a new Pair with specified values
        private Pair(U first, V second)
        {
            this.first = first;
            this.second = second;
        }

        @Override
        // Checks specified object is "equal to" current object or not
        public boolean equals(Object o)
        {
            if (this == o)
                return true;

            if (o == null || getClass() != o.getClass())
                return false;

            Pair<?, ?> pair = (Pair<?, ?>) o;

            // call equals() method of the underlying objects
            if (!first.equals(pair.first))
                return false;
            return second.equals(pair.second);
        }

        @Override
        // Computes hash code for an object to support hash tables
        public int hashCode()
        {
            // use hash codes of the underlying objects
            return 31 * first.hashCode() + second.hashCode();
        }

        @Override
        public String toString()
        {
            return "(" + first + ", " + second + ")";
        }

        // Factory method for creating a Typed Pair immutable instance
        public static <U, V> Pair <U, V> of(U a, V b)
        {
            // calls private constructor
            return new Pair<>(a, b);
        }
    }
    static class BinaryTree{
        Node root;
        void createNode(int[] parent, int i, Node[] created){
            if (created[i] != null)
                return;
            created[i] = new Node(i);
            if (parent[i] == -1)
            {
                root = created[i];
                return;
            }
            if (created[parent[i]] == null)
                createNode(parent, parent[i], created);
            Node p = created[parent[i]];
            if (p.left == null)
                p.left = created[i];
            else
                p.right = created[i];
        }
        Node createTree(int parent[], int n) {
            Node[] created = new Node[n];
            for (int i = 0; i < n; i++)
                created[i] = null;

            for (int i = 0; i < n; i++)
                createNode(parent, i, created);

            return root;
        }
        int maxDepth(Node node) {
            if (node == null)
                return 0;
            else
            {
                int lDepth = maxDepth(node.left);
                int rDepth = maxDepth(node.right);
                if (lDepth > rDepth)
                    return (lDepth + 1);
                else
                    return (rDepth + 1);
            }
        }
        void morrisTraversal(Node root) {
            Node curr,temp;
            curr=root;
            while(curr!=null){
                if(curr.left==null){
                    System.out.print(curr.key+" ");
                    curr=curr.right;
                }
                else{
                    temp=curr.left;
                    while(temp.right!=null && temp.right!=curr){
                        temp=temp.right;
                    }//temp.right!=curr is useful when coming up from down while printing the tree.
                    if(temp.right==null){
                        temp.right=curr;
                        curr=curr.left;
                    }
                    else{
                        temp.right=null;
                        System.out.print(curr.key+" ");
                        curr=curr.right;
                    }
                }
            }
        }
        int preIndex=0;
        void postOrderUsingPreIn(int[] in , int[] pre, int start, int end){
            if(start>end){
                return;
            }
            int inIndex= search(in,start, end, pre[preIndex++]);
            postOrderUsingPreIn(in,pre,start,inIndex-1);
            postOrderUsingPreIn(in,pre,inIndex+1,end);
            System.out.print(in[inIndex]+" ");
        }
        int search(int[] in, int start, int end, int data){
            int i=0;
            for(i=start; i<end; i++){
                if(in[i]==data){
                    return i;
                }
            }
            return i;
        }
    }
    static class treeNode{
        int key;
        ArrayList<treeNode> child;
        treeNode(int key){
            this.key=key;
            child= new ArrayList<>();
        }
    }
    static class Graph {
        int V;
        LinkedList[] adj;
        Graph(int V) {
            this.V = V;
            adj = new LinkedList[V];
            for(int i = 0; i < V ; i++){
                adj[i] = new LinkedList<>();
            }
        }
        void addEdge(int src, int dest) {
            adj[src].add(dest);
        }

    }

    public static void main(String[] args) throws IOException {
        FastReader in = new FastReader();
        PrintWriter out = new PrintWriter(System.out);
        int t=in.nextInt();
        while (t-->0){
            int a=in.nextInt();
            int b=in.nextInt();
            int c=in.nextInt();
            int n=in.nextInt();
            int max= Math.max(a,Math.max(b,c));
            int diff= max-a + max-b +max-c;
            if(n<diff){
                out.println("NO");
            }
            else{
                if((n-diff)%3==0){
                    out.println("YES");
                }
                else{
                    out.println("NO");
                }
            }
        }
        out.flush();
        out.close();
    }
}