#include #include int main() { int64_t height, width, nq; std::cin >> height >> width >> nq; std::vector min(width, height); size_t now = width * height; int64_t h, w; for (size_t i = 0; i < nq; i++) { std::cin >> h >> w; h--; w--; if (min[w] > h) { now -= min[w] - h; min[w] = h; } std::cout << now << std::endl; } }