Even Odds

题意翻译

## 题目大意 作为一个不顺从的人, $Volodya$ 不喜欢当前的事物状态,特别是自然数的顺序(自然数是正整数)。他决心重新安排他们。但是自然数太多,所以 $Volodya$ 决定从 $n$ 开始。他写出下面的数列:首先是从1到 $n$ 的所有奇数整数(以升序排列),然后从1到 $n$ 的所有偶数整数(也按升序排列)。帮助我们的英雄找出:第 $k$ 个数字是多少 ## 输入输出格式 ### 输入格式: 输入一行包含整数n和k(1 <=k<=n<=10^12) 请不要使用%lld说明符来读取或写入C++中的64位整数。最好使用cin、cut流或%I64d说明符。 翻译提供者:蒟蒻烟雨平生

题目描述

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 $ .

输入输出格式

输入格式


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.

输出格式


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

输入输出样例

输入样例 #1

10 3

输出样例 #1

5

输入样例 #2

7 7

输出样例 #2

6

说明

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.