#include<bits/stdc++.h>
using namespace std;
int main()
{
int t, n, i, j = 1;
cin >> t;
while(t--)
{
cin >> n;
int a[n];
int mile = 0, juice = 0;
for(i=0;i<n;i++)
{
cin >> a[i];
int r1 = a[i], p1 = 0;
if(r1 >= 29)
r1 = r1-29, p1++;
double m1 = (double)r1/30.0;
int ans1 = (p1*10) + (ceil(m1)*10);
mile += ans1;
int r2 = a[i], p2 = 0;
if(r2 >= 59)
r2 = r2 - 59, p2++;
double m2 = (double)r2/60.0;
int ans2 = (p2*15) + (ceil(m2)*15);
juice += ans2;
}
if(mile < juice)
cout << "Case " << j++ << ": " << "Mile " << mile << "\n";
else if(juice < mile)
cout << "Case " << j++ << ": " << "Juice " << juice << "\n";
else if(juice == mile)
cout << "Case " << j++ << ": " << "Mile Juice " << mile << "\n";
}
return 0;
}
using namespace std;
int main()
{
int t, n, i, j = 1;
cin >> t;
while(t--)
{
cin >> n;
int a[n];
int mile = 0, juice = 0;
for(i=0;i<n;i++)
{
cin >> a[i];
int r1 = a[i], p1 = 0;
if(r1 >= 29)
r1 = r1-29, p1++;
double m1 = (double)r1/30.0;
int ans1 = (p1*10) + (ceil(m1)*10);
mile += ans1;
int r2 = a[i], p2 = 0;
if(r2 >= 59)
r2 = r2 - 59, p2++;
double m2 = (double)r2/60.0;
int ans2 = (p2*15) + (ceil(m2)*15);
juice += ans2;
}
if(mile < juice)
cout << "Case " << j++ << ": " << "Mile " << mile << "\n";
else if(juice < mile)
cout << "Case " << j++ << ": " << "Juice " << juice << "\n";
else if(juice == mile)
cout << "Case " << j++ << ": " << "Mile Juice " << mile << "\n";
}
return 0;
}
Comments
Post a Comment