Advertisement
borsha06

tariff

Feb 22nd, 2018
157
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. using namespace std;
  3. int main()
  4. {
  5.  
  6.     int n,i,j,k,l1,l2,m,c,d;
  7.     cin>>n;
  8.     for(i=0; i<n; i++)
  9.     {
  10.         cin>>k;
  11.         l1=0;
  12.         l2=0;
  13.         for(j=0; j<k; j++)
  14.         {
  15.             cin>>m;
  16.             l1+=m/30;
  17.  
  18.             l1++;
  19.             c=l1*10;
  20.             l2+=m/60;
  21.  
  22.             l2++;
  23.             d=l2*15;
  24.  
  25.         }
  26.         if(c<d)
  27.             cout<<"Case "<<i+1<<": Mile "<<c<<endl;
  28.         else if(c==d)
  29.             cout<<"Case "<<i+1<<": Mile Juice "<<d<<endl;
  30.         else
  31.             cout<<"Case "<<i+1<<": Juice "<<d<<endl;
  32.  
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement