-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreward.cpp
More file actions
64 lines (53 loc) · 1.13 KB
/
reward.cpp
File metadata and controls
64 lines (53 loc) · 1.13 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <iostream>
#include <vector>
using namespace std;
int fist_reward(int a){
if(a == 1){
return 5000000;
} else if(a >= 2 && a <= 3){
return 3000000;
} else if(a >= 4 && a <= 6){
return 2000000;
} else if(a >= 7 && a <= 10){
return 500000;
} else if(a >= 11 && a <=15){
return 300000;
} else if(a >= 16 && a <= 21){
return 100000;
} else {
return 0;
}
}
int second_reward(int b){
if(b == 1){
return 5120000;
} else if(b >= 2 && b <= 3){
return 2560000;
} else if(b >= 4 && b <= 7){
return 1280000;
} else if(b >= 8 && b <= 15){
return 640000;
} else if(b >= 16 && b <= 31){
return 320000;
} else {
return 0;
}
}
int result(int a, int b){
return fist_reward(a) + second_reward(b);
}
int main(void){
int i;
int t;
int a, b;
vector<int> answer;
cin >> t;
for(i = 0; i < t; i++){
cin >> a >> b;
answer.push_back(result(a,b));
}
for(i = 0; i < answer.size(); i++){
cout << answer[i] << '\n';
}
return 0;
}