The two statements describe two different situations without conflicting with each other. the person can take rest any time after he completed one rest session This means, after taking a rest for 8 hours, he can decide to take another one for 8 hours. One can rest exactly 8 hours This means, he has ...
Your understanding of left of S to left of D is correct. That description was there to remove ambiguity of border regions between jungle and plain lands. It was implied that, you are strictly located on one land and one hour later, you will be located in the next, having no concern about the interme...
Before solving this problem, you need to know how to solve problem 108. Assuming you have solved it, there are two possibilites for the maximum sum. One is the simple case when the maximum occurs without any wrapping. The other case is when, there is wrapping. In the second case, change the sign of ...