N,L = list(map(int, input().split()))

r = [L+i-1 for i in range(1,N+1)]

e = min(r, key=abs)

print((sum(r)-e))
N,L=list(map(int,input().split()))

taste=list(range(L,L+N))

print((sum(taste)-min(taste,key=abs)))
N, L = list(map(int, input().split()))
r = [L + i - 1 for i in range(1, N + 1)]
e = min(r, key=abs)
print((sum(r) - e))

N, L = list(map(int, input().split()))
taste = list(range(L, L + N))
print((sum(taste) - min(taste, key=abs)))

-r = [L + i - 1 for i in range(1, N + 1)] -e = min(r, key=abs) -print((sum(r) - e)) +taste = list(range(L, L + N)) +print((sum(taste) - min(taste, key=abs)))