human
Count of distinct sums formed by N numbers taken form range [ L , R ] | Function to find total number of different sums of N numbers in the range [ L , R ].
To store minimum possible sum with N numbers with all as L.
To store maximum possible sum with N numbers with all as R.
All other numbers in between maxSum and minSum can also be formed so numbers in this range is the final answer.
Driver Code"
How can the above be solved in Python?
 What is a code to count of distinct sums formed by N numbers taken form range [ L , R ] and the other steps required?
assistant
#Here is code to count of distinct sums formed by N numbers taken form range [ L , R ] and the other steps required.
 def countDistinctSums ( N , L , R ) :
	minSum = L * N
	maxSum = R * N
	return maxSum - minSum + 1
if __name__ == " _ _ main _ _ " :
	N = 2
	L = 1
	R = 3
	print ( countDistinctSums ( N , L , R ) )