Pepper has two personalities—— Alice and Bob, and he has to travel a long way to the HongYuan's classroom. Pepper only goes from left to right. There are many teleportation doors.Each door has a location X and a distance Len that can be used. For example, Pepper use teleportation door at ($X=5,Len=10$), he will immediately be transported to the location 15 ($X+Len = 15$).
Whenever he meets a teleportation door, the personality will be changed to the other personality. After that,pepper's new personality can choose whether or not to use the door. If he teleport to another teleportation door,personality will be changed, then he can make a choice too. Neither of personalities want to stay in class. So, you need to find out which personality will stay. Each personality will make optimal decision respectively. Every location of the teleportation door will be different,i
f some location of the teleportation door are same, it will just change personalities one times.It just same teleporation can choose different destination. Pepper is the Alice personality before he meet the first teleportation door.