#include <bits/stdc++.h>
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    vector<long long> a(3);
    long long n, temp = 0;
    cin >> a[0] >> a[1] >> a[2] >> n;
    sort(a.begin(), a.end());
    temp = temp + (a[2] - a[1]);
    temp = temp + (a[2] - a[0]);
    n = n - temp;
    if (n < 0)
      cout << "NO\n";
    else if (n % 3 == 0)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
