K_Sandip_A's blog

By K_Sandip_A, history, 7 weeks 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;
}
 
 
 
 
  • Vote: I like it
  • -8
  • Vote: I do not like it