DGL enjoys digging pits in a courtyard and filling them with water to create water pits. The courtyard is represented as a N x M matrix where each cell can be either a dirt mound "0" or a water pit "1". Water pit cells connected in any of the four directions (up, down, left, right) form a single water pit.
Your task is to:
DGL will also specify changes to turn water pits into dirt mounds K times. Each change might disconnect water pits, affecting their size and count. You need to calculate the number of water pits and the largest water pit size after each change.
The first line contains three integers N, M, and K.
The next N lines contain M integers (0, 1), representing the initial courtyard.
The next K lines contains 2 integers x, y, pair (x, y) representing a position to turn from a water pit into a dirt mound. Each specified position is guaranteed to be a water pit initially.
For testcases 1 ~ 2: guarantee that N = 1.
You need to print K + 1 line.
For the initial courtyard and each change, output two integers in one line seperate by a space: