For Codeforces Round604 Div1 E，it can be showed that this problem is quite similar to a problem in Chinese Contest WinterCamp 2007，the code can be easily searched by Baidu or Google.
for example,the following blog posted the code in 2018 https://www.cnblogs.com/zhoushuyu/p/9146420.html
here is my submission,66347301,i used the code from the blog and change the input by myself
According to the rule about the Third Party code，i think i should not be unrated. MikeMirzayanov Please investigate this matter，Greatly thanks
PS: Mike didn't answer me for 40 hours.. It really makes me anxious..Please help me..
It is fixed now,really thanks.