CF选做

http://codeforces.com/problemset/problem/335/F

原文地址:https://www.cnblogs.com/MobileRobot/p/3721163.html