Chopping Carrots (Hard Version)

Problem Name:
Chopping Carrots (Hard Version)
Site:CodeForces
Links:
Tags:
Problem setters: