Tricks of Tom
CodeChefOpen on judge ↗
Tom is fond of permutations. He tricks every one by his strange problems. Here is one of them. Once he gave Jerry an infinite supply of positive (natural) numbers . Then he challenged him if he could pick up certain set of numbers such that their sum is equal to a particular number N. Jerry being brilliant quickly found a solution. This deeply hurt the ego of Tom. Now Tom was furious and asked
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