链接 http://codeforces.com/problemset/problem/766/D
http://codeforces.com/group/xrTA2IaQje/contest/249959/problem/F