Recall (or "define", if you're not familiar) the so-called ceiling and floor functions, or least/greatest integer functions, respectively; for any integer n,
• ceiling function:
• floor function:
Let x and y be the two numbers Serena picks. She finds that
Assume x and y are not integers. Let m and n be two integers such that m - 1 < x < m and n - 1 < y < n. Then
so m and n are divisors of 100. There's a finite number of distinct divisor pairs (m, n) to consider,
(± 1, ± 100), (± 2, ± 50), (± 4, ± 25), (± 5, ± 5)
whose sums can be one of
± 101, ± 99, ± 52, ± 48, ± 29, ± 21, ± 10, 0
Similarly,
which is maximized if the sum m + n is negative; the largest of these is m + n = -101, so the maximum value of X is 101 + 101 = 202.
The reasoning for the case of either x or y, or both, being integers is nearly identical.