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

l = list([L+x-1 for x in range(1,N+1)])

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

apple_list = list([L+x-1 for x in range(1,N+1)])

print((sum(apple_list) - min(apple_list,key=abs)))
N, L = list(map(int, input().split()))
l = list([L + x - 1 for x in range(1, N + 1)])
print((sum(l) - min(l, key=abs)))

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

-l = list([L + x - 1 for x in range(1, N + 1)]) -print((sum(l) - min(l, key=abs))) +apple_list = list([L + x - 1 for x in range(1, N + 1)]) +print((sum(apple_list) - min(apple_list, key=abs)))