← All problemsSign in

Chef and Intersection Line

CodeChefRating 3729Open on judge ↗

Chef is playing a game that lasts M seconds. She has a matrix A[M][N][N] which contains a single integer in each of the M * N * N cells. For each k such that 1 ≤ k ≤ M, on the k-th second, she chooses some pair (i, j) such that 1 ≤ i, j ≤ N. This will fetch her A[k][i][j] points. She also has a 2-D Cartesian plane which is empty initially. Then for each second k, where k > 1, she will draw a line

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