The Chef and the field
CodeChefOpen on judge ↗
The Chef and his brother own a rectangular field. Chef’s brother wants to sell the field. He calls the Chef one day and says that if any dimension of the field is a prime number, he will sell the field. He tells him that he will measure the exact dimensions the next morning. The Chef does not want to sell the field. He knows that his brother is adamant and there is no way that he will change his
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