-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path448A.cpp
More file actions
34 lines (31 loc) · 701 Bytes
/
448A.cpp
File metadata and controls
34 lines (31 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <iostream>
using namespace std;
int main() {
int a1,a2,a3,b1,b2,b3,n;
cin>>a1>>a2>>a3;
cin>>b1>>b2>>b3;
cin>>n;
int totalCups=a1+a2+a3;
int totalMedals=b1+b2+b3;
if(totalCups>=5){
n-=(totalCups/5);
totalCups%=5;
}
if(totalCups<5&&totalCups!=0){
n--;
totalCups=0;
}
if(totalMedals>=10){
n-=(totalMedals/10);
totalMedals%=10;
}
if(totalMedals<10 &&totalMedals!=0){
n--;
totalMedals=0;
}
if(totalCups==0&&totalMedals==0&&n>=0)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
return 0;
}