You are a player of the game Mine Craft. As a lawful good player, instead of droping TNT everywhere you want to build your village on a vast plain.
The game map could be recognized as a rectangle grid. In one grid, you can set up a gold miner, or an elixir collector, or a headquarter. You also can leave some grids green and vibrant.
However, one restriction for some good reasons is that a headquarter must be next to at least one gold miner and at least one elixir collector. 'Next to' means that their grids share one side -- every grid is next to up, down, left, and right grids.
思路:
只要这种情况排列即可。
HHGHHE
HEHHGH
GHHEHH
AC代码:
print("0.666667")