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

Solution:
#include <bits/stdc++.h>
using namespace std;
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
const int day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
pair<pair<int, int>, pair<int, int> > intersect(pair<int, int> f1,
                                                pair<int, int> f2,
                                                pair<int, int> s1,
                                                pair<int, int> s2) {
  int x5, y5, x6, y6;
  x5 = max(min(f1.first, f2.first), min(s1.first, s2.first));
  x6 = min(max(f1.first, f2.first), max(s1.first, s2.first));
  y5 = max(min(f1.second, f2.second), min(s1.second, s2.second));
  y6 = min(max(f1.second, f2.second), max(s1.second, s2.second));
  if (x5 >= x6 || y5 >= y6) {
    return {{0, 0}, {0, 0}};
  }
  return {{x5, y5}, {x6, y6}};
}
bool isPrime(long long n) {
  if (n < 2) return 0;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) return 0;
  }
  return 1;
}
void faster() {
  if (0) {
    freopen(
        "taskA"
        ".in",
        "r", stdin);
    freopen(
        "taskA"
        ".out",
        "w", stdout);
  }
  if (1) {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
  }
}
const long long INF = 1e18;
const int inf = 1e9;
const int MAXN = (int)2e5 + 123;
const int MOD = (int)1e9 + 7;
const long double PI = acos(-1);
const long double EPS = 3E-16;
namespace MATH_CAL {
const int mod = MOD;
inline long long add(long long a, long long b) {
  return a + b >= mod ? a + b - mod : a + b;
}
inline long long sub(long long a, long long b) {
  return a - b < 0 ? a - b + mod : a - b;
}
inline long long mul(long long a, long long b) {
  return (long long)a * b % mod;
}
inline void Add(long long &a, long long b) { (a += b) >= mod ? a -= mod : 0; }
inline void Sub(long long &a, long long b) { (a -= b) < 0 ? a += mod : 0; }
inline long long qpow(long long first, long long n) {
  long long r = 1;
  for (; n; n /= 2, first = mul(first, first))
    if (n & 1) r = mul(r, first);
  return r;
}
inline long long mod_inv(long long first) { return qpow(first, mod - 2); }
inline long long gcd(long long a, long long b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
}  // namespace MATH_CAL
using namespace MATH_CAL;
void solve() {
  int a, b, c, n;
  cin >> a >> b >> c >> n;
  int mx = max({a, b, c});
  int need_a = mx - a;
  int need_b = mx - b;
  int need_c = mx - c;
  if (need_a + need_b + need_c > n) {
    cout << "NO\n";
    return;
  }
  if (need_a + need_b + need_c == n) {
    cout << "YES\n";
  } else {
    if ((n - (need_a + need_b + need_c)) % 3 == 0) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
}
int main() {
  faster();
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}