2. Two telephone companies agreed to release sets of all possible three-digit telephone numbers such that the first company would have all numbers consisting of odd digits, and the second company only even digits, except for 0. The first company sold its entire first set for $X$ rubles per number, and the second company sold its entire set for $Y$ rubles per number. The difference in revenue between the first company and the second company was 5 rubles. List all possible pairs ( $X, Y$ ), assuming that $X$ and $Y$ are integers less than 250.

(12 points)
Solution. a) There are 5 odd digits: $1,3,5,7,9$ and any of them can stand on each of the 3 positions, the total number of combinations is $N_{\text {odd }}=5^{3}=125$,

b) Even digits are $2,4,6,8$, so 4 digits can stand in the first position, and any of the 4 even digits can stand further, the total number of combinations is $N_{\text {even }}=4^{3}=64$,

c) Considering the difference in revenues, we get the equation $125 X-64 Y=5$, To find the solution, we will use the Euclidean algorithm for finding the GCD. First, let's solve the equation $125 X-64 Y=1$, and find the GCD(125,64):

$125=1 \cdot 64+61, \quad 64=1 \cdot 61+3, \quad 61=20 \cdot 3+1$

From this $\quad 1=61-20(64-1 \cdot 61)=21 \cdot 61-20 \cdot 64=21(125-1 \cdot 64)-20 \cdot 64=21 \cdot 125-41 \cdot 64$. Multiplying by 5, we get 105 and 205. In general, the solutions can be written as: $X=105-64 k, \quad Y=205-125 k, k \in Z$.

Since the price of a room cannot be negative or greater than 250, the values $k=0$ or $k=-1$ are suitable, from which we get the pairs (41; 80), ( $105 ; 205)$.

Answer: ( $41 ; 80)$, ( $105 ; 205)$