The second layer of your software is a CAD system that can design
a cutout of the specified shape. The shape is not specified precisely,
but as a set of areas which should or should not be covered by the
cutout. This task is common for building 3D objects by slicing them
in layers that are cut out one by one and then stacked. Since this
process is very time consuming, you will need to optimize your cut
script for speed.
You need to provide a script that cuts out polygons in a way that the pixmap rendered cutouts will cover all green pixels but never cover any red pixel of the input. The script is fed into the simulator and the resulting png is flood-filled with blue starting from the middle from a large green area.
The submission is not accepted if the filled cutout does not have a blue pixel over any green pixel, or has blue pixel over any red pixel, or there are some components that are only connected with narrow stripes (this is checked by scaling down each side of the pixmap to 25% and the cutout should be still fully connected).
Example inputProvided as input 0.png.
Example outputSee in 0.out, next to 0.png.