This is a problem from Codeforces Round 975. I tried to solve it in the round time and expected to get higher rating. A solution of binary search to this problem jumped out in my mind, and I coded it quickly, but I got WA again and again. Please help me, maybe there are some mathematical wrong or some bugs in my codes, please pointed it out, thank you!!!!!