← All problemsSign in

fun game of the chef

Description Chef was playing a fun event where he was given a number of cards N labeled with an integer on each card and it is represented in an array A. He had to drop them in two baskets, without leaving any empty such that gcd of the integers on the card is one. If the basket has more than one card, the product of the integers in each card is taken as a parameter for gcd of two integers from t

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