C. Чет и нечет

public
yeskendir.sultanov Apr 26, 2024 Never 90
Clone
Python 20.py 10 lines (8 loc) | 166 Bytes
1
n, k = map(int, input().split())
2
3
oddCount = (n + 1) // 2
4
evenCount = n // 2
5
6
if k <= oddCount:
7
print(k * 2 - 1)
8
else:
9
k -= oddCount
10
print(k * 2)