Exercise 4 — Candidates who have chosen the specialization option
In the mountains, a hiker made reservations in two types of accommodations: Accommodation A and Accommodation B. One night in accommodation A costs $24 €$ and one night in accommodation B costs $45 €$. He remembers that the total cost of his reservation is $438 €$. We wish to find the numbers $x$ and $y$ of nights spent respectively in accommodation $A$ and accommodation $B$.
a. Show that the numbers $x$ and $y$ are respectively less than or equal to 18 and 9. b. Copy and complete lines (1), (2) and (3) of the following algorithm so that it displays the possible pairs ( $x ; y$ ).
Input: Processing:
\begin{tabular}{l} $x$ and $y$ are numbers
For $x$ varying from $0$ to $\ldots$ (1)
For $y$ varying from $0$ to $\ldots$ (2)
If $\ldots$ (3) Display $x$ and $y$ End If End For End For
\hline \end{tabular}
Justify that the total cost of the reservation is a multiple of 3.
a. Justify that the equation $8 x + 15 y = 1$ admits at least one solution in integers. b. Determine such a solution. c. Solve the equation (E): $8 x + 15 y = 146$ where $x$ and $y$ are integers.
The hiker remembers having spent at most 13 nights in accommodation A. Show then that he can find the exact number of nights spent in accommodation A and that of nights spent in accommodation B. Calculate these numbers.
\section*{Exercise 4 — Candidates who have chosen the specialization option}
In the mountains, a hiker made reservations in two types of accommodations: Accommodation A and Accommodation B.\\
One night in accommodation A costs $24 €$ and one night in accommodation B costs $45 €$.\\
He remembers that the total cost of his reservation is $438 €$.\\
We wish to find the numbers $x$ and $y$ of nights spent respectively in accommodation $A$ and accommodation $B$.
\begin{enumerate}
\item a. Show that the numbers $x$ and $y$ are respectively less than or equal to 18 and 9.\\
b. Copy and complete lines (1), (2) and (3) of the following algorithm so that it displays the possible pairs ( $x ; y$ ).
\begin{center}
\begin{tabular}{|l|l|}
\hline
Input: Processing: & \begin{tabular}{l}
$x$ and $y$ are numbers \\
For $x$ varying from $0$ to $\ldots$ (1) \\
For $y$ varying from $0$ to $\ldots$ (2) \\
If $\ldots$ (3) Display $x$ and $y$ End If End For End For \\
\end{tabular} \\
\hline
\end{tabular}
\end{center}
\item Justify that the total cost of the reservation is a multiple of 3.
\item a. Justify that the equation $8 x + 15 y = 1$ admits at least one solution in integers.\\
b. Determine such a solution.\\
c. Solve the equation (E): $8 x + 15 y = 146$ where $x$ and $y$ are integers.
\item The hiker remembers having spent at most 13 nights in accommodation A. Show then that he can find the exact number of nights spent in accommodation A and that of nights spent in accommodation B.\\
Calculate these numbers.
\end{enumerate}