Functions On The Segments

CodeForces - 837G