-
Notifications
You must be signed in to change notification settings - Fork 0
/
15953.cpp
61 lines (56 loc) · 1 KB
/
15953.cpp
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
#include <iostream>
using namespace std;
int arr_a[101];
int arr_b[65];
int main() {
int T;
cin >> T;
int rank = 1;
int person = 1;
int index = 1;
for (int i = 1; i <= 6; ++i) { // rank
for (int j = 1; j <= person; ++j) {
arr_a[index] = rank;
++index;
}
++rank;
++person;
}
rank = 5120000;
person = 1;
index = 1;
for (int i = 1; i <= 5; ++i) { // rank
for (int j = 1; j <= person; ++j) {
arr_b[index] = rank;
++index;
}
rank /= 2;
person *= 2;
}
for (int i = 0; i < T; ++i) {
int a, b;
cin >> a >> b;
if (arr_a[a] == 1) {
cout << 5000000 + arr_b[b] << '\n';
}
else if (arr_a[a] == 2) {
cout << 3000000 + arr_b[b] << '\n';
}
else if (arr_a[a] == 3) {
cout << 2000000 + arr_b[b] << '\n';
}
else if (arr_a[a] == 4) {
cout << 500000 + arr_b[b] << '\n';
}
else if (arr_a[a] == 5) {
cout << 300000 + arr_b[b] << '\n';
}
else if (arr_a[a] == 6) {
cout << 100000 + arr_b[b] << '\n';
}
else {
cout << arr_b[b] << '\n';
}
}
return 0;
}