code python: def tinhtong(n): if n % 2 == 0: tong = (n+1) * n//2 else: tong = n * (n+1) //2 + 1 return tong n = int(input()) l = int(input()) r = int(input()) tong = tinhtong(r) - tinhtong(l-1) print(tong)