https://codeforces.com/contest/1101/problem/D

题解: