def main(): isOpen = stdarray.readBool2D() stdarray.write2D(flow(isOpen)) stdio.writeln(percolates(isOpen))
def main(): isAlive = stdarray.readBool2D() stdarray.write2D(living(isAlive)) stdio.writeln(percolates(isAlive))