CF60B Serial Time!
Description
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped $ k×n×m $ , that is, it has $ k $ layers (the first layer is the upper one), each of which is a rectangle $ n×m $ with empty squares ('.') and obstacles ('#'). The water can only be present in the empty squares. The tap is positioned above the square $ (x,y) $ of the first layer, it is guaranteed that this square is empty. Every minute a cubical unit of water falls into the plate. Find out in how many minutes the Serial Guy should unglue himself from the soap opera and turn the water off for it not to overfill the plate. That is, you should find the moment of time when the plate is absolutely full and is going to be overfilled in the next moment.
Note: the water fills all the area within reach (see sample 4). Water flows in each of the 6 directions, through faces of $ 1×1×1 $ cubes.
Input Format
The first line contains three numbers $ k $ , $ n $ , $ m $ ( $ 1
Output Format
The answer should contain a single number, showing in how many minutes the plate will be filled.