Marathon Range
CodeChefOpen on judge ↗
You are given a Integer $N$ . Your task is to find a range $[L,R]$ (both inclusive), such that the sum of all integer in range $L,L+1,L+2,....+R$ becomes equal to $N$. Lets consider $N$ to be 6 then the one of range is $[1,3]$ make the sum equal to $6$ $(1+2+3)$. In all possible ranges you have to print longest one. You have to keep in mind that $ L \lt R $. ### Input - First line will contain
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