#include<bits/stdc++.h>
#define ll unsigned long long int
using namespace std;
int main()
{
ll n, m, i, j;
while(cin >> m)
{
for(i=1;i<=m;i++)
{
cin >> n;
if(n <= 180000)
{
cout << "Case " << i << ": " << 0 << endl;
}
else if(n <= 480000)
{
ll a = n - 180000;
a = ceil(a * (0.1));
if(a < 2000)
a = 2000;
cout << "Case " << i << ": " << a << endl;
}
else if(n <= 880000)
{
ll a = n - 480000;
a = ceil(a * (0.15));
a = a + 30000;
cout << "Case " << i << ": " << a << endl;
}
else if(n <= 1180000)
{
ll a = n - 880000;
a = ceil(a * (0.2));
a = a+90000;
cout << "Case " << i << ": " << a << endl;
}
else if(n > 1180000)
{
ll a = n - 1180000;
a = ceil(a * (0.25));
a = a + 150000;
cout << "Case " << i << ": " << a << endl;
}
}
}
return 0;
}
#define ll unsigned long long int
using namespace std;
int main()
{
ll n, m, i, j;
while(cin >> m)
{
for(i=1;i<=m;i++)
{
cin >> n;
if(n <= 180000)
{
cout << "Case " << i << ": " << 0 << endl;
}
else if(n <= 480000)
{
ll a = n - 180000;
a = ceil(a * (0.1));
if(a < 2000)
a = 2000;
cout << "Case " << i << ": " << a << endl;
}
else if(n <= 880000)
{
ll a = n - 480000;
a = ceil(a * (0.15));
a = a + 30000;
cout << "Case " << i << ": " << a << endl;
}
else if(n <= 1180000)
{
ll a = n - 880000;
a = ceil(a * (0.2));
a = a+90000;
cout << "Case " << i << ": " << a << endl;
}
else if(n > 1180000)
{
ll a = n - 1180000;
a = ceil(a * (0.25));
a = a + 150000;
cout << "Case " << i << ": " << a << endl;
}
}
}
return 0;
}
Comments
Post a Comment