Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
218 B
2
Indexable
Never
#include <iostream>
using namespace std;
int main()
{
	unsigned long long a, b;
	cin >> a >> b;
    if (b > a / 2 + a % 2){
		b -= a / 2 + a % 2;
	    cout << b*2;
	}
	else
	    cout << b*2-1;
	return 0;
}