Fun with flooring factorial
CodeChefOpen on judge ↗
In a class of B students, the teacher wishes to distribute N! [ Factorial(N) ] oranges, such that each one of them gets equal number of oranges. The teacher, being a lazy person, wants to give away oranges such that she has to take minimum number of them back with her. Your job is to help the teacher to determine, given N and B, whether the number of oranges received by each student is even or o
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