Answer
$x=3$ is maximal
Work Step by Step
There are $18$ possible ages from 17 to 34. Therefore, the maximum value of $x$ that is sure to win is the least number greater than $40/18$ by the generalized pigeonhole principle, which is $3$, so the answer is $3$.