-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path12342.cpp
More file actions
39 lines (39 loc) · 1.03 KB
/
12342.cpp
File metadata and controls
39 lines (39 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <bits/stdc++.h>
using namespace std;
int main() {
int i, t;
long sum, n;
scanf("%d", &t);
for (i = 1; i <= t; i++) {
sum = 0;
scanf("%ld", &n);
n = n - 180000;
if (n > 0) {
if (n < 300000)
sum += ceil((double)n * .10);
else
sum += 30000;
n = n - 300000;
if (n > 0) {
if (n < 400000)
sum += ceil((double)n * .15);
else
sum += 60000;
n = n - 400000;
if (n > 0) {
if (n < 300000)
sum += ceil((double)n * .20);
else
sum += 60000;
n = n - 300000;
if (n > 0) {
sum += ceil((double)n * .25);
}
}
}
}
if (sum > 0 && sum < 2000) sum = 2000;
printf("Case %d: %ld\n", i, sum);
}
return 0;
}