K_Sandip_A's blog

By K_Sandip_A, history, 20 months ago, In English

long long n, k; cin >> n >> k;

// For Odd Part
if(k <= (n + 1) / 2){
    cout << k * 2 - 1;
}

// For Even Part
else{
    cout << (k - (n + 1) / 2) * 2;
}

Full text and comments »

  • Vote: I like it
  • -8
  • Vote: I do not like it