Friday, May 1, 2015

448A - Rewards (Codeforces)

#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
#define pf printf
#define sf scanf
#define loop(i, n) for(i=0; i<n; i++)
#define MAX 100

int main()
{
    int n;
    float a1, a2, a3, slv_a;
    float b1, b2, b3, slv_b;
    cin >> a1 >> a2 >> a3;
    cin >> b1 >> b2 >> b3;
    cin >> n;

    slv_a = ceil((a1+a2+a3)/5);
    slv_b = ceil((b1+b2+b3)/10);

    if((slv_a+slv_b)<=n)
        cout <<"YES" << endl;
    else
        cout << "NO" << endl;
    return 0;
}

No comments:

Post a Comment

Compare equality of two string in C

#include <stdio.h> #include<string.h> int main() {     char* country = "Bangladesh";     char* country2;     ...