#include #include int main() { int64_t height, width, nq; std::cin >> height >> width >> nq; std::unordered_map map; size_t now = width * height; int64_t h, w; for (size_t i = 0; i < nq; i++) { std::cin >> h >> w; auto f = map.find(w); if (f != map.end()) { auto &pair = *f; if (pair.second > h) { now -= pair.second - h; pair.second = h; } } else { now -= height - h; map[w] = h; } std::cout << now << std::endl; } }