← All problemsSign in

Am I Lucky!

CodeChefRating 941Open on judge ↗

A school has organized a field trip for a class of $N$ students, of which $X$ students are boys, and the remaining students are girls. Everyone is excited to go trekking, and must form groups of size exactly $K$ to do so. However, boys will only form groups among themselves, and girls will only form groups among themselves. Both boys and girls will form *as many* groups as possible. The remai

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