Question:medium

A hand-held gaming device takes X and Y as two input values. These values get updated as X=XY/2 and Y=Y+1 at each iteration and the game stops when X is greater than or equal to N. For X=2, Y=4 and N=3008, what would be the final value of X when the game stops?

Show Hint

Don't fear small iterative calculations; usually, the pattern stabilizes after 3-4 steps.
Updated On: Jun 12, 2026
  • 5450
  • 9450
  • 12860
  • 13450
Show Solution

The Correct Option is B

Solution and Explanation

Step 1: Read the update rule.
Each iteration replaces $X$ with $\dfrac{XY}{2}$ and then increases $Y$ by 1. The loop stops once $X \ge N = 3008$. We start at $X = 2$, $Y = 4$.
Step 2: Run iteration 1.
$X = \dfrac{2 \times 4}{2} = 4$, then $Y = 5$.
Step 3: Run iteration 2.
$X = \dfrac{4 \times 5}{2} = 10$, then $Y = 6$.
Step 4: Run iterations 3 and 4.
$X = \dfrac{10 \times 6}{2} = 30$, $Y = 7$; then $X = \dfrac{30 \times 7}{2} = 105$, $Y = 8$.
Step 5: Run iterations 5 and 6.
$X = \dfrac{105 \times 8}{2} = 420$, $Y = 9$; then $X = \dfrac{420 \times 9}{2} = 1890$, $Y = 10$. Still below 3008, so continue.
Step 6: Final iteration and stop.
$X = \dfrac{1890 \times 10}{2} = 9450$, which is at least 3008, so the loop halts. The final value of $X$ is 9450, matching option 2.
\[ \boxed{9450} \]
Was this answer helpful?
0