#JSUTFPC2025D. Noble Sequence —— 崇高的序列
Noble Sequence —— 崇高的序列
Statement
Timothy has an integer . He creates a sequence of length by alternating between the integer and , starting with .
For example, if , the sequence is as follows: .
He asks you to find the sum of all integers in the sequence.
Input
The input consists of a single line containing two integers and separated by a space, where satisfies $-1\times 10^{18}\leqslant x\leqslant 1\times 10^{18}$ and satisfies
Output
Output the sum of all integers in this sequence.
Samples
6 3
6
114514 1919810
0
1145141919810 123
1145141919810