# 5. CONDITION

Vladislav Vladimirovich, taking less than 100 rubles, went for a walk. Entering any cafe and having at that moment $m$ rubles $n$ kopecks, he spent $n$ rubles $m$ kopecks ( $m$ and $n$ - natural numbers). What is the maximum number of cafes Vladislav Vladimirovich could visit?
Solution. Method one. Let Vladislav Vladimirovich have $a$ rubles $b$ kopecks upon entering the first cafe. It is clear that $b \leqslant a$. Then upon exiting, he will have $a-b-1$ rubles and $b-a+100$ kopecks. Let $a-b=t \leqslant 99$. Thus, Vladislav Vladimirovich now has $t-1$ rubles and $100-t$ kopecks. The condition for the possibility of visiting the second cafe is $t-1 \geqslant 100-t$, or (since $t$ is an integer) $t \geqslant 51$. After visiting the second cafe, Vladislav Vladimirovich has $2 t-102$ rubles and $201-2 t$ kopecks. To be able to visit the third cafe, it is necessary and sufficient that $t \geqslant 76$. Similarly, to visit the fourth cafe, it is necessary and sufficient that $t \geqslant 89$, to visit the fifth $-t \geqslant 95$, to visit the sixth $-t \geqslant 98$, and to visit the seventh $-t$ must be greater than 99. The latter is impossible, while the previous inequality is feasible. Therefore, the answer is 6.

Method two. To visit a cafe, it is necessary that the number of rubles in Vladislav Vladimirovich's wallet is not less than the number of kopecks. Let the difference between the number of rubles and kopecks be $p$ $(0 \leqslant p$ (in the absence of an example for 6 cafes) | 4 points |
| an example for 6 cafes is provided, but its optimality is not proven | 3 points |
| any examples for fewer than 6 cafe visits or proof that 8 or more cafes cannot be visited | 0 points |
| answer without justification | 0 points |