Chef and Consecutive Numbers
CodeChefOpen on judge ↗
Chef's friend has learned about consecutive numbers recently and to show his intelligence to chef he gives chef a number and asks him to find all the possible set of consecutive numbers that add up to the given number. Input Single integer N whose consecutive numbers are to be found. Output all the groups of consecutive numbers Constraints - 1 ≤ N ≤ 10^9 Example Input: 27 Output: 2 3
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