代码:https://atcoder.jp/contests/abc351/submissions/52947485
思路参考: https://atcoder.jp/contests/abc351/editorial/9898
具体思路:https://www.cnblogs.com/wscqwq/p/18166695.html
法2更好的做法是枚举禁地,向四周连通块贡献 1。(去重)(摘自自己的博客)