rev='made'/> name='keywords'/> name='author'/> ANURANAN: UVa Solution 12157 : Tariff Plan

Welcome Note

Hi,
I'm Anisuzzaman Babla . I am a full stack Android Application Developer. I am working with Android for more than two years. I have completed my graduation from IIT, Jahangirnagar University. I have developed a series of commercially successful apps on Android. Moreover, 10+ of my Apps are live at Google play store. .
Thank You

UVa Solution 12157 : Tariff Plan

#include<stdio.h>
int main()
{
 int T,N,t[100],i,caseno=0,mi,ju;
 scanf("%d",&T);
 while(T--)
 {
  scanf("%d",&N);
  int mi=0,ju=0;
  for(i=0;i<N;++i)
  {
        scanf("%d",&t[i]);
        mi=mi+((t[i]/30)+1);
        ju=ju+((t[i]/60+1));
  }

  mi=mi*10;
  ju=ju*15;
  if(mi<ju) printf("Case %d: Mile %d\n",++caseno,mi);
  else if(mi>ju) printf("Case %d: Juice %d\n",++caseno,ju);
  else printf("Case %d: Mile Juice %d\n",++caseno,ju);
 }
 return 0;
}

No comments:

Post a Comment