Another beginner-level problem, where it really helps to have a solid understanding of data types and truncation. The solution is only a few lines. We are given two numbers per test case, $1 \leq n, k \leq 10^{12}$. Consider a list of natural numbers, partitioned by the first odd numbers up to $n$, followed by the first even numbers up to $n$. Both segments are in ascending order, with the evens concatenated onto the back of our odds. $0$ is not included in either set, since we are talking about natural numbers.
We want the value of the $k$th number.