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
| #define _CRT_SECURE_NO_WARNINGS #define PI 3.14159265358979323846
#include <iostream> #include <vector> #include <stdio.h> #include <algorithm> #include <math.h> using namespace std;
int Answer; int Score(const int &x, const int &y) { int arr[20] = {9, 13, 4, 18, 1, 20, 5, 12, 9, 14, 11, 8, 16, 7, 19, 3, 17, 2, 15, 10}; return arr[((int)(atan2(y, x) * 180 / PI + 360 + 9) / 18) % 20]; } int main(int argc, char **argv) { int T, test_case; int num; int A, B, C, D, E;
setbuf(stdout, NULL); cin >> T; for (test_case = 0; test_case < T; test_case++) { scanf("%d", &A); scanf("%d", &B); scanf("%d", &C); scanf("%d", &D); scanf("%d", &E); scanf("%d", &num); Answer = 0;
for (int i = 0; i < num; i++) { int a, b; scanf("%d %d", &a, &b); if (A * A >= a * a + b * b) { Answer += 50; } else if (B * B < a * a + b * b && a * a + b * b < C * C) { Answer += Score(a, b) * 3; } else if (D * D < a * a + b * b && a * a + b * b < E * E) { Answer += Score(a, b) * 2; } else if (a * a + b * b < D * D) { Answer += Score(a, b); } }
cout << "Case #" << test_case + 1 << endl; cout << Answer << endl; }
return 0; }
|