Untitled
unknown
c_cpp
2 years ago
184 B
6
Indexable
#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;
} Editor is loading...