math,ad hoc , binary search
problem link- I am not able to understand the editorial also .... help... its an interesting problem
AtCoder Beginner Contest 483 discussion
ICPC NA North Central and South Division