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



arr = [like + i for i in range(n)]



arr.sort(key=lambda x:abs(x))



print((sum(arr[1:])))

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

arr = [like + i for i in range(n)]

arr.sort(key=abs)

print((sum(arr[1:])))

n, like = list(map(int, input().split()))
arr = [like + i for i in range(n)]
arr.sort(key=lambda x: abs(x))
print((sum(arr[1:])))

n, like = list(map(int, input().split()))
arr = [like + i for i in range(n)]
arr.sort(key=abs)
print((sum(arr[1:])))

-arr.sort(key=lambda x: abs(x)) +arr.sort(key=abs)