题目链接:https://ac.nowcoder.com/acm/contest/5477/J
题解链接:https://blog.csdn.net/oneplus123/article/details/106052326/