این مسابقه به صورت حضوری در تاریخ ۱۴ آذر ۱۴۰۳ در سایت دانشکده برق و کامپیوتر دانشگاه تهران برگزار میشود. علاقهمندان میتوانند به صورت همزمان در مسابقه آنلاین که شامل همان سوالات میباشد شرکت کنند.
Zeinab is a huge fan of chess and programming, but typical chess soon became boring for her, so she started having fun with rook pieces.
She found a chessboard with rows and columns and placed rooks on it. Zeinab’s game is made of the following rules:
Notice that the field a rook is at can be attacked or not. Initially, Zeinab placed the rooks in a certain layout on the board and will make P moves. After each move, determine how many fields are attacked. Every rook can be moved to any free field on the whole board (not only across column and row).
The first line of input contains integers N, K and P.
Each of the following K lines contains three integers R, C, X. which denote that initially there is a rook of power X on the field (R, C).
Each of the following P lines contains four integers , , , which denote that the rook has moved from field to field .
The output must consist of P lines, the line containing the total number of attacked fields after moves.