We’re preparing your current view and syncing the latest data.
You are given two integers n and k. Consider the sequence where all odd numbers from 1 to n are listed first in ascending order, followed by all even numbers from 1 to n in ascending order. Your task is to find the k-th number in this sequence.
Two integers n and k separated by space.
Print the k-th number in the described sequence.
1 <= k <= n <= 10^12
Example 1
Input
10 3
Output
5
Explanation
The sequence is [1, 3, 5, 7, 9, 2, 4, 6, 8, 10]. The 3rd number is 5.
Example 2
Input
7 7
Output
6
Explanation
The sequence is [1, 3, 5, 7, 2, 4, 6]. The 7th number is 6.