WINDOW FRAMES
CodeChefOpen on judge ↗
Chef is making Window frames for his new office, for this he has n wooden Logs whose lengths are l1, l2, ... ln respectively. Chef Doesn’t want to break any logs or Stick 2 or more logs together. To make a h × w Window Frame, he needs two Logs with lengths equal h and two with length . The Chef wants as much sunlight in as possible and for it he has decided to make from the available logs as
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.
Sign in to chat with the tutor and save your progress.
Sign in to start