Find Your Solution Here

Codeforces

codeforces solution 448A – Rewards

Problem link—448A – Rewards
/*

Harun-or-Rashid

CSEDU-23rd Batch

*/

#include <bits/stdc++.h>

using namespace std;
int main()
{
    int n,a[3],b[3],sum_cups=0,sum_medels=0,i;
    for(i=0;i<3;i++){
        scanf("%d",&a[i]);
    }
    for(i=0;i<3;i++){
        scanf("%d",&b[i]);
    }
    scanf("%d",&n);
    for(i=0;i<3;i++){
        sum_cups+=a[i];
        sum_medels+=b[i];
    }
    if(sum_cups%5==0){
        sum_cups=sum_cups/5;
    }
    else{
        sum_cups=sum_cups/5+1;
    }
    if(sum_medels%10==0){
        sum_medels=sum_medels/10;
    }
    else{
        sum_medels=sum_medels/10+1;
    }
    if(sum_cups+sum_medels<=n){
        printf("YES\n");
    }
    else{
        printf("NO\n");
    }
    return 0;
}

Leave a Reply