Let $t_i$ be the value of $x$ after finishing the $i^{th}$ loop. Therefore, the returned value is $t_{y-1}$.
$t_0 = 2x + y$
$t_1 = 2t_0 + y = 2(2x + y) + y = 4x + 3y$
$t_2 = 2t_1 + y = 2(4x + 3y) + y = 8x + 7y$
$t_i = 2^{i+1}x + (2^{i+1} - 1)y = 2^{i+1}(x+y) - y$
Therefore, returned value = $t_{y-1} = 2^{y}(x+y) - y$
A. When $x=20, y=10 \implies t_{9} = 2^{10}(30) - 10 \ngtr 2^{20}$
B. When $x=20, y=20 \implies t_{19} = 2^{20}(40) - 20 > 2^{20}$
C. When $x=20, y=10 \implies t_{9} = 2^{10}(30) - 10 \nless 2^{10}$
D. When $x=10, y=20 \implies t_{19} = 2^{20}(30) - 20 > 2^{20}$
Answer - B, D