Codeforces Div1A

Submitted a solution but that doesn’t seem to work for precision loss.

Went through the tutorial, but not able to understand a specific observation which is stated as
" This algorithm works because if Liss divides an interval into two intervals A and B and she enters A, she will never enter B ."

Tutorial link: Codeforces Round #162 Tutorial - Codeforces

Can someone please explain to me what is the signification of the above line.

When she enters a part of the interval, it’s a subset of the initial interval.
(k,k+d)->A is a subset of (k-d, k+d). So the interval she enters is (k, k+d)->A. She will never be able to enter (k-d, k)->B from (k, k+d)->A

1 Like

Thanks @everule1