https://atcoder.jp/contests/abc236/tasks/abc236_d