9.4. On the table, there are 365 cards, each with a different number written on its back. Vasya can pay 1 ruble to choose any 3 cards and ask Borya to arrange them from left to right in increasing order of the numbers on their backs. Can Vasya achieve the following goal by paying 2000 rubles: to arrange all 365 cards in increasing order from left to right on the table?
9.4. It can be done.

First, we prove a lemma.
Lemma: Suppose Vasya can arrange a certain \(N-1\) cards in the required order on the table by paying \(x\) rubles, where \(N \leqslant 3^{k}\). Then, he can place the remaining 1 card in the correct position by paying no more than \(k\) rubles, i.e., the total cost will not exceed \(x+k\) rubles.
Proof of the lemma: We use mathematical induction.
The case \(k=1\) is obvious.
Assume the statement holds for all \(N \leqslant 3^{k-1}\), we will prove it for \(N \leqslant 3^{k}\).

Clearly, Vasya's first step should be to determine the position of the \(N\)-th card relative to the cards \(A\) and \(B\) placed at the \(\left[\frac{N}{3}\right]\) and \(\left[\frac{2N}{3}\right]\) positions. Since cards \(A\) and \(B\) divide the already arranged cards into three segments, Vasya can use 1 ruble to determine which segment the \(N\)-th card belongs to.

Since each segment contains no more than \(3^{k-1}-1\) cards, by the induction hypothesis, Vasya can determine the exact position of the \(N\)-th card within that segment by paying no more than \(k-1\) rubles.
The lemma is proved.
Next, we use the lemma to show that Vasya can achieve his goal by spending no more than 2000 rubles.
To arrange the first three cards, he spends 1 ruble;
To insert the cards from 4 to 9 (a total of 6 cards), he spends no more than 2 rubles per card;

To insert the cards from 10 to 27, he spends no more than 3 rubles per card;

To insert the cards from 28 to 81, he spends no more than 4 rubles per card;

Next, for the cards from 82 to 243, he spends no more than 5 rubles per card, and for the cards from 244 to 365, he spends no more than 6 rubles per card. This means that Vasya will need to spend
\[
\begin{array}{l}
1 + 6 \times 2 + 18 \times 3 + 54 \times 4 + 162 \times 5 + 122 \times 6 \\
= 1825 < 2000
\end{array}
\]
rubles to achieve his goal.