Rosetta Problems

Shortest Bridge

https://onlinejudge.u-aizu.ac.jp/problems/2735