fork download
  1. #include<stdio.h>
  2. struct xy { int x, y; }a[121];
  3. int sb(xy a, xy b) { return (a.x < b.x) * 2 + (a.y < b.y); }
  4. int main() {
  5. int n, b,i, j, k, ans = 1e9;
  6. scanf("%d%d", &n,&b);
  7. for (i = 0; i < n; i++)scanf("%d%d", &a[i].x, &a[i].y);
  8. for (i = 0; i < n; i++) for (k = 0; k < n; k++){
  9. int cnt[4] = { 0, }, res = 0;
  10. for (j = 0; j < n; j++) cnt[sb({ a[i].x + 1,a[k].y + 1 }, a[j])]++;
  11. for (j = 0; j < 4; j++)if (res < cnt[j])res = cnt[j];
  12. if (ans > res)ans = res;
  13. }
  14. printf("%d", ans);
  15. return 0;
  16. }
Success #stdin #stdout 0s 4216KB
stdin
7 10
7 3
5 5
9 7
3 1
7 7
5 3
9 1
stdout
2