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