Yeongseon draws a picture with a very simple graphics editor.
The editor works like this.
- The canvas is an infinite two dimensional grid of pixels.
- There are four colors, red, green, blue, and transparent, written as 'R', 'G', 'B', and '.' in that order.
- The editor has a clipboard that stores one rectangular picture.
- The user can paste the clipboard picture onto the canvas, and the user picks the cell where the top left corner of the picture lands.
- When the picture is pasted, a red, green, or blue pixel overwrites the canvas pixel under it, and a transparent cell leaves the canvas pixel as it was.
The canvas starts out fully transparent, and Yeongseon has already copied a finished picture into the clipboard.
Yeongseon pastes the picture for T seconds. At second i she pastes it so that its top left cell is at (i,i).
Given the clipboard picture and T, write a program that counts the red pixels, the green pixels, and the blue pixels left on the canvas after T seconds.