Promi_38

cf 1294A

Oct 22nd, 2021
656
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits\stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int t;
  8.     cin >> t;
  9.    
  10.     while(t--)
  11.     {
  12.         int a, b, c, n;
  13.         cin >> a >> b >> c >> n;
  14.         int sum = a+b+c+n;
  15.         if(sum % 3 == 0 && a <= sum / 3 && b <= sum / 3 && c <= sum / 3) printf("YES\n");
  16.         else printf("NO\n");
  17.     }
  18. }
  19.  
RAW Paste Data