This is a real-life puzzle encountered by one of my friends, again.
After landing and arriving at the airport, I want to pick my baggage up quickly. The problem is that the baggage claim is $500$ m away. Luckily, along the way there are many travelators. Let's say, the total length of travelators is $250$ m (hence, the total length of non-travelators is also $250$ m). The travelator speed is $1$ m/s. I can also walk in $1$ m/s but I need to reserve $10\%$ of my walking time to take a rest.
How long and where should I take the rest to quickly arrive at the baggage claim? Should I rest at the travelator or not at the travelator?
Note: Assume you are going to walk for $700$ s, you need to take a rest for $70$ s and can only truly walk for $630$ s. Let's say there is no travelator in the statement, then you need a total of $\frac{5000}{9}=555.55...$ s ($55.55...$ s for rest and $500$ s for walking) to arrive at the baggage claim.
Bonus: Can you generalize the solution for $N$ m away, $K$ m part of travelators, $V_T$ m/s of travelator speed, $V_m$ m/s of my speed, and $P \%$ of rest?