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 PYTHON3):

Solution:
#!/usr/bin/env python
# coding: utf-8

# In[4]:


# import math
# for i in range(int(input())):
#     a,b=map(int,input().split())
#     if a%b==0 or a%b<=1.5:
#         print(a)
#     else:
#         no=int(a/b)
#         no+=.5
#         print(math.floor(b*no))


# In[10]:


# import math
# for i in range(int(input())):
#     a,b=map(int,input().split())
#     frac,asd=math.modf(a/b)
#     if a%b==0 or frac<=.5:
#         print(a)
#     else:
#         no=int(a/b)
#         no+=.5
#         print(int(b*no))


# In[4]:


# n=int(input())
# s=input()
# d={}
# a=0
# for i in range(n-1):
#     a=s[i]+s[i+1]
#     if d.get(a):
#         d[a]+=1
#     else:
#         d[a]=1
# max_key = max(d, key=d.get)
# print(max_key)
    
    


# In[ ]:


# n,k=map(int,input().split())
# a=list(map(int,input().split()))
# a.sort()
# if k==0 and a[0]==0:
#     print(-1)
# elif k==0 and a[0]==1:
#     print(-1)
# elif k==0:
#     print(a[0]-1)
# elif  len(a)>1  and k!=n and a[k]==a[k-1] :print(-1)
# else:print(a[k-1])


# In[1]:


# n=int(input())
# a=list(map(int,input().split()))
# k=0
# while k<n:
#     for i in range(n):
#         f=1
#         if a[i]==-1:pass
#         elif a[i]%3==0:
#             for j in range(n):
#                 if a[j]==a[i]//3:
#                     print(a[i],end=' ')
#                     print(a[j],end=' ')
#                     a[i],a[j]=-1,-1
#                     f=0
#                     k+=1
#                     break
# #             if f :
# #                 for j in range(n):
# #                 if a[j]==a[i]*2:
# #                     print(a[i],end=' ')
# #                     print(a[j],end=' ')
# #                     a[i],a[j]=-1,-1
# #                     f=0
# #                     k+=1
#             break
        
#     for i in range(n):
#         f=1
#         if a[i]==-1:pass
#         elif a[i]%2==0:
#             for j in range(n):
#                 if a[j]==a[i]*2:
#                     print(a[i],end=' ')
#                     print(a[j],end=' ')
#                     a[i],a[j]=-1,-1
#                     f=0
#                     k+=1
#                     break
                    
#             break


# In[15]:


# n=int(input())
# a=list(map(int,input().split()))
# d={}
# lis=[]
# for i in a:
#     if d.get(i):pass
#     else:
#         d[i]=1
# l=len(d)
# while l>0:
#     if d[a[n-1]]:
#         lis.append(a[n-1])
#         d[a[n-1]]=0
#         l-=1
#     n-=1

# lis.reverse()
# print(len(d))
# for i in lis:
#     print(i,end=" ")
        


# In[20]:


# n=int(input())
# s=input()
# ans,c=0,0
# for i in s:
# #     print(i,c)
#     if i=='x':
#         c+=1
#     else:
#         if c>=3:ans+=c-2
#         c=0
# if c>=3:ans+=c-2
# print(ans)


# In[24]:


# n,k=map(int,input().split())
# a=list(map(int,input().split()))
# t=list(map(int,input().split()))
# s=0
# for i in range(n):
#     a[i]+=s
#     s=a[i]
    

# for i in t:

#     for j in range(n):
#         if j==0 and a[j]>=i:
#             print(1,abs(i))
#             break
            
#         elif a[j]>=i:
#             print(j+1,abs(a[j-1]-i))
#             break


# In[24]:


# a=[10,25,37]
# n=3
# def bsearch(no):
#     low=0
#     high=n
#     mid=(low+high)//2
#     while high-low>1:
#         if a[mid]==no:return mid
#         print(high,low,mid)
#         if no>a[mid]:low=mid
#         elif no<a[mid]:high=mid
#         mid=(low+high)//2
#     return high

# print(bsearch(12))


# In[ ]:



# n,k=map(int,input().split())
# a=list(map(int,input().split()))
# t=list(map(int,input().split()))

# def bsearch(no):
#     low=0
#     high=n
#     mid=(low+high)//2
#     while high-low>1:
#         if a[mid]==no:return mid
#         # print(high,low,mid)
#         if no>a[mid]:low=mid
#         elif no<a[mid]:high=mid
#         mid=(low+high)//2
#     return high
    
# s=0
# for i in range(n):
#     a[i]+=s
#     s=a[i]
    

# for i in t:
    
#     if i<=a[0]:
#         print(1,abs(i))
#     else:
#         j=bsearch(i)
#         print(j+1,abs(i-a[j-1]))


# In[ ]:


# for test_case in range(int(input())):
#     n,k=map(int,input().split())
#     s=input()
#     c,ans=0,0
#     for i in s:
#         if i=='0':
#             c+=1
#             if c==(2*k)+1:
#                 ans+=1
#                 c=0
#     if c==(2*k)+1:
#                 ans+=1
#                 c=0
#     print(ans)
                
        
        
    


# In[ ]:


# for test_case in range(int(input())):
#     n=int(input())
#     a=list(map(int,input().split()))
#     a.sort()
#     ans=1000000000
#     for i in range(n-1):
#         ans=min(ans,abs(a[i+1]-a[i]))
#     print(ans)


# In[1]:


# for test_case in range(int(input())):
#     n=int(input())
#     a=list(map(int,input().split()))
#     a.sort()
#     i,d=0,{}
#     par,p,o=0,0,0
#     for i in a:
#         # print(p,o)
#         if d.get(i-1):
#             # print("yahh",i,"asd")
#             # print(i)
#             d[i-1]-=1
#             if i %2==0:o-=1
#             else:p-=1
            
            

#         elif i%2==0:
#             if d.get(i) or d.get(i)==0:d[i]+=1
#             else:d[i]=1
#             p+=1
#         else:
#             if d.get(i) or d.get(i)==0:d[i]+=1
#             else:d[i]=1
#             o+=1
        
        
        
#     if o%2!=0 or p%2!=0:print("NO")
#     else :print("YES")


# In[ ]:


# for i in range(int(input())):
#     n,k=map(int,input().split())
#     f=1
#     if k ==1:
#         print(n)
#         f=0
#     elif k>=n:
#         print(1)
#         f=0
#     else:
#         for i in range(2,int(n**.5)+1):
#             if n%i==0 and i<=k and n//i<=k:
#                 print(min(i,n//i))
#                 f=0
#                 break
#     if f:print(n)


# In[1]:


# n,k=map(int,input().split())
# S=[input().strip() for i in range(n)]
# SET=set(S)
# ANS=0
 
# for i in range(n-1):
#     for j in range(i+1,n):
        
#         rest=''
#         for l in range(k):
#             if S[i][l]==S[j][l]:
#                 rest+=S[i][l]
#             else:
#                 rest+=chr(236-ord(S[i][l])-ord(S[j][l]))
 
#         if rest in SET:
#             ANS+=1
# print(ANS//3)


# In[5]:


# n=int(input())
# a=list(map(int,input().split()))
# d={}
# l=[]
# nu=1
# f=1
# for i in range(1,31):
#     l.append(2**i)
# ans=0    

# for i in a:
#     if d.get(i)==None:d[i]=1
#     else:d[i]+=1
# for i in a:
#     # print(ans,f)
#     f=1
#     for j in l:
#         if d.get(j-i):
#             if j==i*2 :
#                 if d.get(j-i)>=2:
#                     f=0
#             else:
#                 f=0
#                 break
#     if f :ans+=1
        
# print(ans)
    



# In[12]:


for t in range(int(input())):
    a,b,c,d=(map(int,input().split()))
    m=max(a,b,c)
    if d==(m-a)+(m-b)+(m-c):print("YES")
    elif d>(m-a)+(m-b)+(m-c):
        if ((d-((m-a)+(m-b)+(m-c)))%3)==0:print("YES")
        else:
            print("NO")
    else:print("NO")
        
        
    
    


# In[1]:





# In[ ]:





# In[3]:





# In[ ]: