Saturday 28 May 2016

Tariff Plan (UVA 12157, UVALive 4405, Regionals 2008 >> Asia - Kuala Lumpur)

///     Raihan Ruhin
///     CSE, Jahangirnagar University.
///     Dhaka-Bangladesh.
///     id: raihanruhin (topcoder / codeforces / codechef / uva), 3235 (lightoj)
///     mail: raihanruhin@ (yahoo / gmail / facebook)
///     blog: ruhinraihan.blogspot.com

#include<bits/stdc++.h>
using namespace std;

#define SET(a) memset(a,-1,sizeof(a))
#define CLR(a) memset(a,0,sizeof(a))
#define PI acos(-1.0)

#define MOD 1000000007
#define MX 100010

int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);
    int kk=1, tc, n, m, duration;
    string s;
    cin>>tc;
    while(tc--)
    {
        int mile=0, juice=0;
        cin>>n;
        while(n--)
        {
            cin>>duration;
            mile+=(duration/30+1)*10;
            juice+=(duration/60+1)*15;
        }
        if(mile<juice) cout<<"Case "<<kk++<<": Mile "<< mile <<"\n";
        else if(juice<mile) cout<<"Case "<<kk++<<": Juice "<< juice <<"\n";
        else cout<<"Case "<<kk++<<": Mile Juice "<< mile <<"\n";
    }

    return 0;
}

No comments:

Post a Comment