← All problemsSign in

Maximum Score

CodeChefRating 843Open on judge ↗

Chef is participating in a tournament. He must face $N$ opponents. If he wins against the $i$-th opponent, he will receive $A_i$ coins; whereas if he loses, he will receive $B_i$ coins. It's guaranteed that $A_i \ge B_i$. Chef doesn't want to bring too much attention to himself, so he decides that he will **lose at least once.** Under this constraint, what's the maximum total number of coin

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