← All problemsSign in

Jatzz Subway Travel

Problem description: Jatzz has recently started commuting by subway. We know that a one ride subway ticket costs 'a' rubles. Besides, Jatzz found out that he can buy a special ticket for 'm' rides (he can buy it several times). It costs 'b' rubles. Jatzz did the math; he will need to use subway 'n' times. Help Jatzz, tell him what is the minimum sum of money he will have to spend to make n rides?

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start