Google Code Jam Japan 2011 予選問題B_ ref: http://qiita.com/items/3f04ade9bbaf68aae947