Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <iostream>
- #include <algorithm>
- #define N 602
- #define eps (1e-7)
- using namespace std;
- double d[N];
- int main() {
- int n, m;
- cin >> n;
- d[0] = -0.005;
- for (int i = 1; i <= n; i++) {
- cin >> d[i];
- d[i] *= 0.001;
- }
- cin >> m;
- for (int i = n + 1; i <= n + m; i++) {
- cin >> d[i];
- d[i] *= 0.001;
- d[i] -= 0.008;
- }
- sort(d, d + n + m + 1);
- double res;
- d[n + m + 1] = 1e9;
- for (int i = 0; i <= n + m; i++) {
- if (d[i + 1] - d[i] - 0.013 > eps || abs(d[i + 1] - d[i] - 0.013) < eps ) {
- res = (d[i] + 0.005) * 180;
- break;
- }
- }
- cout.precision(6);
- cout << fixed << res;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement