// https://atcoder.jp/contests/abc038/submissions/1165321 #include #include #include #include #ifdef NO_UNLOCK_IO #define getchar_unlocked getchar #define putchar_unlocked putchar #endif struct FastIO { static void scan(double &x) { scanf("%lf", &x); } template static void scan(Integral &x) { int k, m=0; x = 0; for (;;) { k = getchar_unlocked(); if (k == '-') { m = 1; break; } else if ('0' <= k && k <= '9') { x = k-'0'; break; } } for (;;) { k = getchar_unlocked(); if (k < '0' || k > '9') break; x = x*10 + k-'0'; } if (m) x = -x; } template static void scan(Arithmetic &x, Rest&... y) { scan(x); scan(y...); } static void print(double x, char c) { printf("%.12f%c", x, c); } static void print(const char *x, char c) { printf("%s%c", x, c); } template static void print(Integral x, char c) { int s=0, m=0; char f[20]; if (x < 0) { m = 1; x = -x; } while (x) { f[s++] = x%10; x /= 10; } if (!s) f[s++] = 0; if (m) putchar_unlocked('-'); while (s--) putchar_unlocked(f[s]+'0'); putchar_unlocked(c); } template static void println(Arithmetic x) { print(x, '\n'); } }; template typename RandomIt::difference_type li_subseq( RandomIt first, RandomIt last, const typename RandomIt::value_type &inf ) { std::vector dp(last-first, inf); for (RandomIt i=first; i &u, const std::pair &v ) { return u.first!=v.first? (u.first < v.first) : (u.second > v.second); } } comp; int main() { size_t xx, yy, N; FastIO::scan(xx, yy, N); std::vector> x(N); for (size_t i=0; i a(N); for (size_t i=0; i