Ben and Cubes
CodeChefOpen on judge ↗
Ben is a little boy who is fond of cubes. He has a toy box which has 10^9 rows and N columns and he knows how many cubes are there in each column. Now he wants to play a game. He takes the box and rotates it clockwise. Now, he wants to know how many cubes are present in the Qth column. He knows that whenever he is rotating the box, all the cubes inside stay intact and once he completes 1 rotation
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