Provinces of ChefLand
CodeChefOpen on judge ↗
Following the example of ByteLand, the King of ChefLand has decided to divide the country into provinces. The map of ChefLand is a rectangular matrix consisting of N rows and M columns. The cell at the crossing of the ith row and the jth column denotes a single ChefLand city. So, there are N × M cities. There are Ai, j people living in the city at the crossing of the ith row and the jth column.
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