← All problemsSign in

Rook Placement

CodeChefRating 2872Open on judge ↗

Chef and Sous Chef are playing a game. There are N rooks right next to a chessboard. The chessboard has R rows and C columns. The rows are numbered from 1 to R from top to bottom. The columns are numbered from 1 to C from left to right. Chef will place the N rooks within the R*C cells of the chessboard. He may keep multiple rooks on the same cell. You may assume that each cell is large enough to

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