SaveMary
CodeChefOpen on judge ↗
Raju bhai is a new don in town. He enjoys hanging people every weekend. This weekend he assembled N people in a circular manner (1,2,..N,1) and choosen a random integer K. He framed certain rules to hang people. Rule 1: He skips K-1 persons (inclusive) and hang Kth person. Rule 2: He always starts counting from 1st person. Rule 3: The last person will be allowed to live for rest of his life. S
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