Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <algorithm>
- #include <cstdio>
- #include <cstdlib>
- using namespace std;
- #define fill(a, x) memset (a, x, sizeof(a))
- const int INF = 0x3f3f3f3f;
- int n, x, y, a[1111][1111], mn, ans, curd;
- double xx, yy;
- int main() {
- scanf("%d", &n);
- fill(a, 0);
- for (int i = 0; i < n; ++i) {
- scanf("%lf%lf", &xx, &yy);
- x = (int)(xx * 1000) % 1000;
- y = (int)(yy * 1000) % 1000;
- if (x < 0) x += 1000;
- if (y < 0) y += 1000;
- ++a[x][y];
- }
- mn = INF;
- ans = 0;
- for (int i = 0; i < 1000; ++i)
- for (int j = 0; j < 1000; ++j) {
- x = min(abs(i - 1000), i);
- y = min(abs(j - 1000), j);
- curd = x * x + y * y;
- if (a[i][j] > ans) {
- ans = a[i][j];
- mn = curd;
- } else
- if (a[i][j] == ans) mn = min(mn, curd);
- }
- printf("%d %.16lf", ans, sqrt(mn + 0.) / 1000);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement