n, l = list(map(int, input().split()))

if l > 0:

    c = l

elif l + n - 1 < 0:

    c = l + n - 1

else:

    c = 0

print((l * n + n * (n - 1) // 2 - c))
n, l = list(map(int, input().split()))

a, b = sorted([l, l + n - 1])

print((sum(range((a + 1 if a > 0 else a),

                (b - 1 if b < 0 else b) + 1))))
n, l = list(map(int, input().split()))
if l > 0:
    c = l
elif l + n - 1 < 0:
    c = l + n - 1
else:
    c = 0
print((l * n + n * (n - 1) // 2 - c))

n, l = list(map(int, input().split()))
a, b = sorted([l, l + n - 1])
print((sum(range((a + 1 if a > 0 else a), (b - 1 if b < 0 else b) + 1))))

-if l > 0: -    c = l -elif l + n - 1 < 0: -    c = l + n - 1 -else: -    c = 0 -print((l * n + n * (n - 1) // 2 - c)) +a, b = sorted([l, l + n - 1]) +print((sum(range((a + 1 if a > 0 else a), (b - 1 if b < 0 else b) + 1))))