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;
}

  

posted @ 2013-06-15 11:29  OpenSoucre  阅读(192)  评论(0编辑  收藏  举报