TripTastic
A school wants to plan a trip for a group of $K$ students and **one** mentor. A hotel is booked for their stay, where the rooms are formatted in form of a matrix $A$ with $N$ rows and $M$ columns. There are a total of $N\times M$ rooms where the room $(i, j)$ has a capacity of $A_{(i,j)}$ people. The *distance* between the rooms $(i_1, j_1)$ and $(i_2, j_2)$ is given by $\max( |i_1-i_2| , |j_1-
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