Codeforces Round #188 (Div. 2) A. Even Odds
#include <iostream>
#define LL long long
using namespace std;
int main(){
LL n,k;
cin >> n >>k;
LL split = n%2 ? n/2+1 : n/2;
if( k <= split ) cout<<-1+2*k<<endl;
else cout<<2*(k-split)<<endl;
return 0;
}

浙公网安备 33010602011771号