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