Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits\stdc++.h>
- using namespace std;
- int main()
- {
- int t;
- cin >> t;
- while(t--)
- {
- int a, b, c, n;
- cin >> a >> b >> c >> n;
- int sum = a+b+c+n;
- if(sum % 3 == 0 && a <= sum / 3 && b <= sum / 3 && c <= sum / 3) printf("YES\n");
- else printf("NO\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement