| 1 | #define MAXN 100100 |
| 2 | struct RMST { |
| 3 | struct point { |
| 4 | int i; ll x, y; |
| 5 | point() : i(-1) { } |
| 6 | ll d1() { return x + y; } |
| 7 | ll d2() { return x - y; } |
| 8 | ll dist(point other) { |
| 9 | return abs(x - other.x) + abs(y - other.y); } |
| 10 | bool operator <(const point &other) const { |
| 11 | return y == other.y ? x > other.x : y < other.y; } |
| 12 | } best[MAXN], arr[MAXN], tmp[MAXN]; |
| 13 | int n; |
| 14 | RMST() : n(0) {} |
| 15 | void add_point(int x, int y) { |