Rosetta Problems

Small d and k

https://atcoder.jp/contests/abc254/tasks/abc254_e