I couldn’t solve this problem from codeforces: Even Odds so I looked online for solutions. I found one, I get the first part of if statement condition where we check the first half of the array but am unable to understand the else part condition… please help… here’s the solution:

```
#include <iostream>
using namespace std;
int main()
{
long long n, k;
cin >> n >> k;
if (k <= (n + 1) / 2)
{
cout << k * 2 - 1 << endl;
}
else
{
cout << (k - (n + 1) / 2) * 2 << endl;
}
return 0;
}
```