← All problemsSign in

Chef and Gordon Ramsay

CodeChefRating 2536Open on judge ↗

Chef really admires Gordon Ramsay. Both of them have restaurant chains. While Chef's restaurant chain consists of $N$ facilities (numbered $1$ through $N$), Gordon Ramsay has only $3$, and yet Gordon's restaurants are superior. Chef's marketing team has figured out how to take over the market. According to them, the problem is that the customers have too many restaurants to choose from and that Go

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