http://hihocoder.com/contest/msbop2014r2a/problem/2