-
Notifications
You must be signed in to change notification settings - Fork 0
/
beecrowd | 1836 pokémon!
50 lines (48 loc) · 1.25 KB
/
beecrowd | 1836 pokémon!
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
#include <stdio.h>
#include <math.h>
int readInt() {
int result = 0;
char ch = getchar_unlocked();
while (ch < '0' || ch > '9') {
ch = getchar_unlocked();
}
result = ch - '0';
while (1) {
ch = getchar_unlocked();
if (ch < '0' || ch > '9') break;
result = result * 10 + (ch - '0');
}
return result;
}
int main() {
int n;
n = readInt();
char s[110];
for (int i = 1; i <= n; i++) {
int l, bs, iv, ev;
scanf("%s %d", s, &l);
printf("Caso #%d: %s nivel %d\n", i, s, l);
for (int i = 0; i < 4; i++) {
bs = readInt();
iv = readInt();
ev = readInt();
double calc = floor(((iv + bs + sqrt(ev) / 8.0) * l) / 50.0) + 5.0;
switch (i) {
case 0: {
calc = floor(((iv + bs + sqrt(ev) / 8.0 + 50) * l) / 50.0) + 10.0;
printf("HP: %.0lf\n", calc);
} break;
case 1:
printf("AT: %.0lf\n", calc);
break;
case 2:
printf("DF: %.0lf\n", calc);
break;
case 3:
printf("SP: %.0lf\n", calc);
break;
}
}
}
return 0;
}