← All problemsSign in

Boring Trip

CodeChefRating 2879Open on judge ↗

The famous country Chefland can be represented as a number line. There are $N$ attractions in Chefland, among which the $i$-th attraction's position is $X_i$, and the time taken to completely explore it is $S_i$ hours. For convenience, we'll assume the time needed to move $1$ unit distance is $1$ hour. One day, Chef decides to visit $K$ **distinct** attractions. He wants you to plan the trip, inc

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