Skip to content

Commit 6c4d26c

Browse files
committed
Added 1294A - Collecting Coins.cpp
1 parent e21c89d commit 6c4d26c

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

1294A - Collecting Coins.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// ॐ नमः शिवाय
2+
#include<bits/stdc++.h>
3+
using namespace std;
4+
#define ll long long
5+
6+
// Code Written By: Vikash Patel
7+
// Codeforces Profile: https://codeforces.com/profile/vikashpatel
8+
9+
int main()
10+
{
11+
int t;
12+
cin>>t;
13+
while(t--)
14+
{
15+
long long a,b,c,n;
16+
cin>>a>>b>>c>>n;
17+
long long sum = a+b+c+n;
18+
long long maxi = max(a,max(b,c));
19+
if(sum%3==0 && sum/3>=maxi)
20+
cout<<"YES"<<endl;
21+
else
22+
cout<<"NO"<<endl;
23+
}
24+
return 0;
25+
}

0 commit comments

Comments
 (0)