Codeforces Round 188 (Div. 2)
A
Even Odds
Codeforces
900
原题
←B →
翻译中…

Being a nonconformist, Volodya is displeased with the current state of things, particularly with the order of natural numbers (natural number is positive integer number). He is determined to rearrange them. But there are too many natural numbers, so Volodya decided to start with the first $*n*$. He writes down the following sequence of numbers: firstly all odd integers from $1$ to $*n*$ (in ascending order), then all even integers from $1$ to $*n*$ (also in ascending order). Help our hero to find out which number will stand at the position number $*k*$.

翻译中…

Input

翻译中…

The only line of input contains integers $*n*$ and $*k*$ ($1 ≤ *k* ≤ *n* ≤ 10^{12}$).

翻译中…

Please, do not use the %lld specifier to read or write 64-bit integers in C++. It is preferred to use the cin, cout streams or the %I64d specifier.

翻译中…

Output

翻译中…

Print the number that will stand at the position number $*k*$ after Volodya's manipulations.

翻译中…

Note

翻译中…

In the first sample Volodya's sequence will look like this: {1, 3, 5, 7, 9, 2, 4, 6, 8, 10}. The third place in the sequence is therefore occupied by the number 5.

翻译中…

样例

Input #1
10 3
Output #1
5
InputCopy OutputCopy
Input #2
7 7
Output #2
6
InputCopy OutputCopy
题目信息
题号
318A
时间限制
1 s
内存限制
256 MB
标签
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。