参考博客: https://www.luogu.org/problemnew/solution/P3804 转载于:https://www.cnblogs.com/Aiahtwo/p/11557881.html