#include <iostream>
#include <algorithm>
using namespace std;

int main() {
	int t;
	cin>>t;
	while(t--){
	int a,b,c,n;
	cin>>a>>b>>c>>n;
	int themax=max({a,b,c});
	n=n-(themax-a);
	n=n-(themax-b);
	n=n-(themax-c);
	if(n%3==0){
		cout<<"YES"<<endl;
	}
	else{
		cout<<"NO"<<endl;
	}
	}
	
	return 0;
}