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

apples = list(range(l, l + n))

if 0 in apples:

    print((sum(apples)))

elif l < 0:

    print((sum(apples) - max(apples)))

else:

    print((sum(apples) - min(apples)))

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

apples = list(range(l, l + n))

print((sum(apples) - min(apples, key=abs)))

n, l = list(map(int, input().split()))
apples = list(range(l, l + n))
if 0 in apples:
    print((sum(apples)))
elif l < 0:
    print((sum(apples) - max(apples)))
else:
    print((sum(apples) - min(apples)))

n, l = list(map(int, input().split()))
apples = list(range(l, l + n))
print((sum(apples) - min(apples, key=abs)))

-if 0 in apples: -    print((sum(apples))) -elif l < 0: -    print((sum(apples) - max(apples))) -else: -    print((sum(apples) - min(apples))) +print((sum(apples) - min(apples, key=abs)))