Distinct Sums
CodeChefOpen on judge ↗
Chef Nipun was traveling through the universe and found two integers $X$ and $Y$. Being the curious soul who he is, he wants to find the number of sums that are possible using $N$ numbers such that the smallest is $X$ and the largest is $Y$ ###Input: - Three integers $N$, $X$, $Y$ are given. ###Output: Print the number of different possible sums. ###Constraints - $1 \leq N, X, Y \le
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