← All problemsSign in

Amphibian Escape

CodeChefRating 1778Open on judge ↗

Chef is building a robot frog, which he would like to be able to climb out of a well quickly. The well has a height of $H$ units. Initially, the frog is placed at the bottom of the well. Let $A$ denote the *jumping power* of the frog, and $B$ denote the *slipperiness* of the well's wall. The frog is initially at position $X = 0$. Every second, the following two steps happen in order: - First

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