#JSUTFPC2025D. Noble Sequence —— 崇高的序列

Noble Sequence —— 崇高的序列

Statement

Timothy has an integer xx. He creates a sequence of length nn by alternating between the integer xx and x-x, starting with xx.

For example, if n=5n = 5, the sequence is as follows: x,x,x,x,xx, -x, x, -x, x.

He asks you to find the sum of all integers in the sequence.

Input

The input consists of a single line containing two integers xx and nn separated by a space, where xx satisfies $-1\times 10^{18}\leqslant x\leqslant 1\times 10^{18}$ and nn satisfies 0n1×10180\leqslant n\leqslant 1\times 10^{18}

Output

Output the sum of all integers in this sequence.

Samples

6 3
6
114514 1919810
0
1145141919810 123
1145141919810