UVA 12157 - Tariff Plan

Problem PDF

Solution:

#include
int main()
{
    int t, n,m,j,a,i;
    scanf("%d",&t);
    for(i=1;i<=t;i++)
    {
    scanf("%d",&n);
    m=j=0;
    while(n--)
    {
    scanf("%d",&a);
    m+=(a+30)/30;
    j+=(a+60)/60;
    }
    m*=10;
    j*=15;
    if(m
https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/12157/12157.cpp