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

taste=[L+i for i in range(N)]

print((sum(taste)-min(taste,key=abs)))
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()))
taste = [L + i for i in range(N)]
print((sum(taste) - min(taste, key=abs)))

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

-taste = [L + i for i in range(N)] +taste = list(range(L, L + N))