Chef and Matrix Division
Chef has n × n array A of non-negative integers. He wants to divide this array by p-1 horizontal dividers and p-1 vertical dividers into p2 blocks such that maximum sum of elements of each block will be the smallest. More formally, Chef want to choose p-1 horizontal dividers 0 = h0 h1 hp = n and p-1 vertical dividers 0 = v0 v1 vp = n to minimize the next value: Input - The first line of each te
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