#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  cin >> t;
  while (t--) {
    long long int a, b, c, n;
    cin >> a >> b >> c >> n;
    long long int arr[3] = {a, b, c};
    sort(arr, arr + 3);
    long long int temp = arr[2] - arr[0];
    arr[0] += temp;
    temp += arr[2] - arr[1];
    arr[1] = arr[2] - arr[1];
    if (temp > n)
      cout << "NO"
           << "\n";
    else {
      n = n - temp;
      if (n % 3 == 0)
        cout << "YES"
             << "\n";
      else
        cout << "NO"
             << "\n";
    }
  }
  return 0;
}
