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 \le t \le 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 \le a, b, c, n \le 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
[{"code": "a = int(input())\nfor i in range(a):\n    a1, b, c, n = list(map(int, input().split()))\n    t = max(a1, b, c)\n    if ((a1 + b + c + n) % 3 == 0 and t <= (a1 + b + c + n)//3 ):\n        print('YES')\n    else:\n        print('NO')\n", "passed": true, "time": 0.23, "memory": 14240.0, "status": "done"}, {"code": "t = int(input())\nfor _ in range(t):\n\ta, b, c, n = map(int, input().split())\n\n\tm = max(a, b, c)\n\n\tsu = m-a + m-b + m-c\n\n\tif n < su:\n\t\tprint(\"NO\")\n\t\tcontinue\n\n\tn -= su\n\tif n%3 == 0:\n\t\tprint(\"YES\")\n\telse:\n\t\tprint(\"NO\")", "passed": true, "time": 0.25, "memory": 14228.0, "status": "done"}, {"code": "import sys\ninput = sys.stdin.readline\n\nfor _ in range(int(input())):\n\ta, b, c, n = map(int, input().split())\n\ta, b, c = sorted([a, b, c])\n\tn -= (c-a)\n\tn -= (c-b)\n\tif n >= 0 and n%3 == 0:\n\t\tprint('YES')\n\telse:\n\t\tprint('NO')", "passed": true, "time": 0.14, "memory": 14324.0, "status": "done"}, {"code": "t=int(input())\nfor _ in range(t):\n    a,b,c,n=list(map(int,input().split()))\n    a,b,c=sorted([a,b,c])\n    x=2*c-b-a\n   # print(x)\n    if n<x:\n        print(\"NO\")\n    elif (x-n)%3==0:\n        print(\"YES\")\n    else:\n        print(\"NO\")\n", "passed": true, "time": 0.21, "memory": 14012.0, "status": "done"}, {"code": "#!/usr/bin/env python3\n# coding: utf-8\n# Last Modified: 22/Jan/20 08:07:33 PM\n\n\nimport sys\n\n\ndef main():\n    for tc in range(int(input())):\n        a, b, c, n = get_ints()\n        x = a + b + c + n\n        if x % 3 != 0:\n            print(\"NO\")\n        else:\n            y = max(a, b, c)\n            if (x // 3) >= y:\n                print(\"YES\")\n            else:\n                print(\"NO\")\n\n\nget_array = lambda: list(map(int, sys.stdin.readline().split()))\n\n\nget_ints = lambda: list(map(int, sys.stdin.readline().split()))\n\n\ninput = lambda: sys.stdin.readline().strip()\n\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14256.0, "status": "done"}, {"code": "#JMD\n#Nagendra Jha-4096\n\n \nimport sys\nimport math\n\n#import fractions\n#import numpy\n \n###File Operations###\nfileoperation=0\nif(fileoperation):\n    orig_stdout = sys.stdout\n    orig_stdin = sys.stdin\n    inputfile = open('W:/Competitive Programming/input.txt', 'r')\n    outputfile = open('W:/Competitive Programming/output.txt', 'w')\n    sys.stdin = inputfile\n    sys.stdout = outputfile\n\n###Defines...###\nmod=1000000007\n \n###FUF's...###\ndef nospace(l):\n    ans=''.join(str(i) for i in l)\n    return ans\n \n \n \n##### Main ####\nt=int(input())\nfor tt in range(t):\n    #n=int(input())\n    a,b,c,n= map(int, sys.stdin.readline().split(' '))\n    give = (a+b+c+n)//3\n    x=give-a\n    y=give-b\n    z=give-c\n\n    if (give*3==a+b+c+n) and (x>=0) and (y>=0) and (z>=0) and (x+y+z==n):\n        print(\"YES\")\n    else:\n        print(\"NO\")\n    #a=list(map(int,sys.stdin.readline().split(' ')))\n    \n    \n#####File Operations#####\nif(fileoperation):\n    sys.stdout = orig_stdout\n    sys.stdin = orig_stdin\n    inputfile.close()\n    outputfile.close()", "passed": true, "time": 0.15, "memory": 14272.0, "status": "done"}, {"code": "for _ in range(int(input())):\n    a,b,c,n = [int(s) for s in input().split()]\n    a,b,c = sorted([a,b,c])\n    w = c-a+c-b\n    if w>n:\n        print(\"NO\")\n    else:\n        if (n-w)%3==0:\n            print(\"YES\")\n        else:\n            print(\"NO\")", "passed": true, "time": 0.2, "memory": 14284.0, "status": "done"}, {"code": "t=int(input())\nwhile(t):\n    t-=1\n    a,b,c,n=list(map(int,input().split()))\n    d=max(a,b,c)\n    f=(d-a)+(d-b)+(d-c)\n    if(f>n):\n        print(\"NO\")\n        continue\n    n-=f\n    if(n%3==0):\n        print(\"YES\")\n    else:\n        print(\"NO\")\n", "passed": true, "time": 0.15, "memory": 14348.0, "status": "done"}, {"code": "t = int(input())\nfor _ in range (t):\n    a, b, c, n = list(map(int, input().split()))\n    d = 3 * max(a, b, c) - a - b- c\n    e = n - d\n    if e >= 0 and e % 3 == 0:\n        print(\"YES\")\n    else:\n        print(\"NO\")", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "#-------------Program--------------\n#----Kuzlyaev-Nikita-Codeforces----\n#-------------Round615-------------\n#----------------------------------\n\nt=int(input())\nfor i in range(t):\n    a,b,c,n=map(int,input().split())\n    a=[a,b,c];a.sort()\n    k=a[2]-a[1]+a[2]-a[0]\n    if n<k:\n        print('NO')\n    else:\n        if (n-k)%3!=0:\n            print('NO')\n        else:\n            print('YES')", "passed": true, "time": 0.22, "memory": 14116.0, "status": "done"}, {"code": "for _ in range(int(input())):\n    a,b,c,n=map(int,input().split())\n    s=a+b+c\n    mx=max(a,b,c)\n    if((s+n)%3==0 and (s+n)//3 >= mx):\n        print(\"YES\")\n    else:\n        print(\"NO\")", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "import sys\nimport math\nfrom collections import defaultdict\nfrom collections import deque\nfrom itertools import combinations\nfrom itertools import permutations\ninput = lambda : sys.stdin.readline().rstrip()\nread = lambda : list(map(int, input().split()))\ngo = lambda : 1/0\ndef write(*args, sep=\"\\n\"):\n  for i in args:\n    sys.stdout.write(\"{}{}\".format(i, sep))\nINF = float('inf')\nMOD = int(1e9 + 7)\nYES = \"YES\"\nNO = \"NO\"\n\nfor _ in range(int(input())):\n  try:\n    a, b, c, n = read()\n    x = max([a, b, c])\n    n -= x - a \n    n -= x - b \n    n -= x - c \n\n    if n < 0:\n      print(NO)\n      go()\n    \n    if n % 3 == 0:\n      print(YES)\n    else:\n      print(NO)\n\n  except:\n    continue", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "import sys\n\n# inf = open('input.txt', 'r')\n# reader = (line.rstrip() for line in inf)\nreader = (line.rstrip() for line in sys.stdin)\ninput = reader.__next__\n\nt = int(input())\nfor _ in range(t):\n    a, b, c, n = list(map(int, input().split()))\n    if (a + b + c + n) % 3 == 0:\n        each = (a + b + c + n) // 3\n        if a <= each and b <= each and c <= each:\n            print('YES')\n        else:\n            print('NO')\n    else:\n        print('NO')\n\n# inf.close()\n", "passed": true, "time": 0.23, "memory": 14312.0, "status": "done"}, {"code": "\nT=int(input())\nfor _ in range(T):\n    a,b,c,n=list(map(int,input().split()))\n    mx=max(a,b,c)\n    tot=mx-a+mx-b+mx-c\n\n    if(n<tot):\n        print('NO')\n    else:\n        n=n-tot\n        if(n%3==0):\n            print('YES')\n        else:\n            print('NO')\n    \n", "passed": true, "time": 0.14, "memory": 14220.0, "status": "done"}, {"code": "import sys\ninput = sys.stdin.readline\n\nt=int(input())\n\nfor test in range(t):\n    a,b,c,n=list(map(int,input().split()))\n\n    M=max(a,b,c)\n    n-=(M-a)+(M-b)+(M-c)\n\n    if n<0:\n        print(\"NO\")\n    else:\n        if n%3==0:\n            print(\"YES\")\n        else:\n            print(\"NO\")\n", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "t = int(input())\nans = list()\nfor i in range(t):\n    (a, b, c, n) = map(int, input().split())\n    d = [a, b, c]\n    d.sort()\n    if d[2] - d[0] + d[2] - d[1] > n:\n        ans.append('NO')\n    else:\n        n -= d[2] - d[0]\n        n -= d[2] - d[1]\n        if n %3 != 0:\n            ans.append('NO')\n        else:\n            ans.append('YES')\nprint(*ans,sep='\\n')\n", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "for _ in range(int(input())):\n    a, b, c, n = list(map(int, input().split()))\n    a, b, c = sorted([a, b, c])\n    delta = (c - a) + (c - b)\n    if n >= delta and (n - delta) % 3 == 0:\n        print(\"YES\")\n    else:\n        print(\"NO\")\n", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "\nt = int(input())\n\nfor loop in range(t):\n\n    a,b,c,n = list(map(int,input().split()))\n\n    n -= max(a,b,c) - a\n    n -= max(a,b,c) - b\n    n -= max(a,b,c) - c\n\n    if n >= 0 and n % 3 == 0:\n        print (\"YES\")\n    else:\n        print (\"NO\")\n", "passed": true, "time": 0.15, "memory": 14220.0, "status": "done"}, {"code": "n = int(input())\nfor i in range(n):\n    a, b, c, d = list(map(int, input().split()))\n    need = max(a, b, c)\n    d -= (need - a)\n    d -= (need - b)\n    d -= (need - c)\n    if d >= 0 and d % 3 == 0:\n        print('YES')\n    else:\n        print('NO')\n", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "for _ in range(int(input())):\n    a, b, c, n = list(map(int, input().split()))\n    s = (a+b+c+n)\n    if s % 3 == 0 and s // 3 >= a and s // 3 >= b and s // 3 >= c:\n        print('YES')\n    else:\n        print('NO')\n", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "for _ in range(int(input())):\n    a, b, c, n = map(int, input().split())\n    mm = max(a, b, c)\n    n -= (mm-a)\n    n -= mm-b\n    n-= mm - c\n    if n >= 0 and n % 3 == 0:\n        print(\"YES\")\n    else:\n        print(\"NO\")", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}]