首页 > 代码库 > #256 (Div. 2)A. Rewards

#256 (Div. 2)A. Rewards

题意:三种奖杯各ai个,三种奖牌各bi个,给出N个柜子,每个柜子不能同时放奖杯奖牌,不能放大于5个奖杯,10个奖牌

思路:水

 1 #include<bits/stdc++.h>
 2 using namespace std;
 3 
 4 int main(){
 5     int x;
 6     int sum=0,sum1=0,s,s1,n;
 7     for(int i=1;i<=3;i++){
 8         cin>>x;
 9         sum+=x;
10     }
11     for(int i=1;i<=3;i++){
12         cin>>x;
13         sum1+=x;
14     }
15     if(sum%5==0) s=sum/5;
16     else s=sum/5+1;
17     if(sum1%10==0) s1=sum1/10;
18     else s1=sum1/10+1;
19     cin>>n;
20     if(s+s1<=n){
21         cout<<"YES"<<endl;
22     }
23     else cout<<"NO"<<endl;
24 }

 

#256 (Div. 2)A. Rewards