Problem link: 1654C - Alice and the Cake
I tried solving the problem with a different approach. It would be great if someone helps me analyze the time and space complexity of my submission, because I feel it should be within constraints and somehow it fails!
Thanks for your time reading :)
Problem solved: see ACGN reply