Untitled

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