参考资料:
[1]:http://www.cnblogs.com/widsom/p/7750656.html
[2]:https://www.luogu.org/problemnew/solution/P1083