AtCoder社の https://atcoder.jp/contests/abc046/tasks/abc046_b をScratchで解きました。 Scratcher's AtCoderを使ってます。