Advertisement
Plabon_dutta

UVA 12157- Tariff Plan

Apr 1st, 2021
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int t, c=1;
  7.     scanf("%d", &t);
  8.     while(t--) {
  9.         int n, in, sum=0, m=0, j=0, t1, t2;
  10.         scanf("%d", &n);
  11.         while(n--) {
  12.             scanf("%d", &sum);
  13.             t1=sum/30;
  14.             t1++;
  15.             m+=t1*10;
  16.             t2=sum/60;
  17.             t2++;
  18.             j+=(t2*15);;
  19.         }
  20.         printf("Case %d: ", c++);
  21.         if(m<j)
  22.             printf("Mile %d\n", m);
  23.         else if(m==j)
  24.             printf("Mile Juice %d\n", m);
  25.         else
  26.             printf("Juice %d\n", j);
  27.     }
  28.     return 0;
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement