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.


-----Examples-----
Input
10 3

Output
5
Input
7 7

Output
6


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

Difficulty: interview

Starter code:

Solutions:
N,K=input().split()
N,K=int(N),int(K)

if(N%2==0):
    if(K<=N//2):
        print(2*K-1)
    else:
        K-=N//2
        print(2*K)

else:
    if(K<=N//2+1):
        print(2*K-1)
    else:
        K-=N//2+1
        print(2*K)



x= input()
n,k= x.split()
n=int(n)
k=int(k)
if(n%2==0):
    if(k<=n/2):
        ans=2*k-1
    else:
        ans= 2+(k-(int(n/2))-1)*2
else:
    if(k<=(n/2+1)):
        ans=2*k-1
    else:
       ans= 2+(k-(int(n/2)+1)-1)*2
print(int(ans))       


s = input().split()
n, k = (int(i) for i in s)
cnt1 = n - (n // 2)
if k <= cnt1:
    print(-1 + k * 2)
else:
    k -= cnt1
    print(k * 2)

n,k=list(map(int,input().split()))
d=n+1>>1
print((k*2-1,(k-d)*2)[k>d])


a,b=list(map(int,input().split()))
c=b-(a+1)//2
print(2*c if c>0 else 2*b-1)


a,b=list(map(int,input().split()))
c=b-(a+1)//2
print([2*b-1,2*c][c>0])


n, k = list(map(int, input().split()))
m = n // 2 + n % 2
if k <= m:
    print(2 * k - 1)
else:
    print(2 * (k - m))


#!/usr/bin/env python 3

import sys

n = sys.stdin.read()
a = n.split()

n = int(a[0])
k = int(a[1])

if k <= (n + 1) // 2:
    print(2 * k - 1)
else:
    print((k - (n + 1) // 2) * 2)


n, k = map(int, input().split())
if k <= int((n + n % 2) / 2):
    print(2 * (k - 1) + 1)
else:
    tmp = k - int(n / 2) - n % 2
    print(2 * tmp)

n, k = [int(x) for x in input().split()]
even = n // 2
odd = n - even
if k <= odd:
  print(2*k-1)
else:
  print(2*(k-odd))


n, k = [int(x) for x in input().strip().split()]
if k > (n + 1) // 2:
	k -= (n + 1) // 2
	print(2 * k)
else:
	print(2 * k - 1)



a,b=list(map(int,input().split()))
mid=(int)(a/2+a%2)
if b<=mid:
    print(b*2-1)
else:
    N=(int)(b-mid)*2
    print(N)


L=list(input().split())
n, k=int(L[0]), int(L[1])
if n%2==0:
    if k<=int(n/2): print(2*k-1)
    else: print(2*(k-int(n/2)))
else:
    if k<=int((n+1)/2): print(2*k-1)
    else: print(2*(k-int((n+1)/2)))

3

n, k = tuple(map(int, input().split()))
if k <= n - n // 2:
    print(2 * k - 1)
else:
    print(2 * (k - n + n // 2))


n, k = [int(x) for x in input().split()]

if k <= (n + 1) // 2:
    print(2 * (k - 1) + 1)
else:
    k -= (n + 1) // 2
    print(2 * k)


def task1(string):
    n=int(string[:string.index(' ')])
    k=int(string[string.index(' '):])
    if n%2 == 0:
        if k <= n/2:
            return 2*k-1
        else:
            return 2*(k - n//2)
    else:
        if k <= n//2+1:
            return 2*k-1
        else:
            return 2*(k - n//2 - 1)

print(task1(input()))



n,k = list(map (int, input().split()))
half = int(n/2) + n%2
if k > half:
  k -= half
  print(2*k)
else:
  print(2*k-1)


x = input().split()
n = int(x[0])
k = int(x[1])

first_even_position = (n+1)//2 + 1
if (k < first_even_position) :
    number = k * 2 - 1
else:
    number = (k - first_even_position + 1) * 2

print(number)

n, k = list(map(int, input().split()))

if k <= (n + 1) // 2:
    print(k * 2 - 1)
else:
    print((k - (n + 1) // 2) * 2)


import sys
	
def main():
	n, k = list(map(int, sys.stdin.readline().split()))
	max_odd_pos = int(n/2)
	if n % 2 == 1:
		max_odd_pos += 1
	
	if k <= max_odd_pos:
		print(k*2 - 1)
	else:
		print((k - max_odd_pos) * 2)
	
def __starting_point():
    return(main())

__starting_point()

n,k=list(map(int,input().split()))
a=(n+1)//2
if (k<=a) :
	print(k*2-1)
else :
	print((k-a)*2)


n, k = map(int, input().split())
if k <= (n + 1) // 2:
    print(k + k - 1)
else:
    k -= (n + 1) // 2
    print(k + k)

n, k = list(map(int, input().split()))
l = (n + 1) >> 1
print(k + k - 1 if k <= l else (k - l) << 1)


import sys
from math import ceil
my_file = sys.stdin
#my_file = open("input.txt", "r")
line = my_file.readline().split()
n, k = int(line[0]), int(line[1])

if n%2 == 0:
    if k <= n/2:
        print(k*2-1)
    else:
        print(int((k-n/2)*2))
else:
    if k <= ceil(n/2):
        print(k*2-1)
    else:
        print(int((k-ceil(n/2))*2))

n, k = map(int, input().split())
if k > (n + 1) // 2: print(2 * (k - (n + 1) // 2))
else: print(2 * k - 1)