题目链接:http://codeforces.com/contest/1343/problem/D 题解:https://www.cnblogs.com/stelayuri/p/12749332.html