#include <iostream> #include <algorithm> using namespace std; int main() { int a, b, n; scanf("%d%d%d", &a, &b, &n); int ans = 1e9; for(int i = 1; i <= n; i ++) { int res, m; scanf("%d%d",&res, &m); bool f1 = false, f2 ...