Oshwiciqwq studies Physics in a shabby classroom in his sophomore year. The classroom has n rows and m columns of seats, which are narrowly set like a matrix. There is a huge screen in the front of the classroom.
The whole classroom can be seen as a plane, and every seat can be seen as a point on it. The set of all seats' coordinates is {(x,y)∣1≤x≤n,1≤y≤m,x∈Z+,y∈Z+}. Additionally, the screen can be seen as a segment, with two endpoints a (0,1) and (0,m).
As a student who loves studying, he always wants to seat in the front row, so that he can see the whole screen clearly. He thinks a seat is good if and only if there are no other people blocking him from seeing the whole screen. Formally, the seat at (a,b) is good if and only if there is no other person sitting on the seat that is on the segment between (a,b) and any point on the segment (0,1)−(0,m) (including endpoints).
However, today he arrived at the classroom as early as usual, only to find kkk people had already taken their seats. What's worse, while he was busy searching for a good seat, some people changed their seats one by one. Totally there are qqq events of changing seats. He is extremely anxious now, so could you please help him count how many seats are good after each of the qqq changing events?
Obviously, a seat can only be occupied by at most one person at the same time.