| 9 | using namespace std; |
| 10 | |
| 11 | int main() { |
| 12 | |
| 13 | long long nums, pos; |
| 14 | cin >> nums >> pos; |
| 15 | if (nums % 2 == 0) { |
| 16 | if (pos > nums / 2) { |
| 17 | cout << (pos - (nums / 2)) * 2; |
| 18 | } |
| 19 | else { |
| 20 | cout << pos * 2 - 1; |
| 21 | } |
| 22 | } |
| 23 | else { |
| 24 | if (pos > nums / 2+1) { |
| 25 | cout << (pos - (nums / 2+1)) * 2; |
| 26 | } |
| 27 | else { |
| 28 | cout << pos * 2 - 1; |
| 29 | } |
| 30 | |
| 31 | } |
| 32 | return 0; |
| 33 | } |
nothing calls this directly
no outgoing calls
no test coverage detected