Untitled

mail@pastecode.io avatar
unknown
c_cpp
8 months ago
184 B
3
Indexable
Never
#include <iostream>
int main() {
	long long a, b;
	std::cin >> a >> b;
	if (b > (a + a % 2) / 2) {
		std::cout << (b - ((a + a % 2)/ 2)) * 2;
	}else std::cout << b  * 2  - 1;
}