Toilet paper problem

Question

Hints

Answer