Box Distribution
CodeChefOpen on judge ↗
Gaurav has a box of infinte capacity containing infinite "sandwiches". His friend has N boxes, each numbered as 1,2,3....N, all of capacity N each. His task is to distribute the items from the infinite box into these N boxes such that no 2 boxes have the same number of items and every box is filled, i.e. non empty. Also, an even numbered box cannot have even number of "sandwiches", and an odd numb
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