← All problemsSign in

Space Tourism

Let's move 1000 years ahead in time. We're in 3019. Space tourism is the thing now! There are **$N$** planets numbered $1$ to $N$. Space X provides transportation services from $i$th planet to $(i + 1)$th planet such that 1 ≤ $i$ th planet to $(i + 1)$th planet, then he has to pay the toll of $(i + 1)$th planet. In future, the universe is a flatland, so the planets are in 2D and their positions

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