5. Given that $k$ is a positive integer, the organizing committee of a tennis tournament arranges for $2 k$ players to participate in the competition, such that every two players play one match, and exactly one match is played each day. Each player participates in his first match on the day he arrives at the venue, and in his last match on the day he leaves the venue. The organizing committee must pay one coin to the hotel for each player participating in the tournament every day. The committee wants to design a schedule that minimizes the total payment to the hotel for all players staying at the hotel. Find this minimum value.
5. The minimum value sought is $\frac{1}{2} k\left(4 k^{2}+k-1\right)$.

Let the days of the competition be denoted as $1,2, \cdots, \mathrm{C}_{2 k}^{2}$.
Let $b_{1} \leqslant b_{2} \leqslant \cdots \leqslant b_{2 k}$ be the days of arrival of the participants in non-decreasing order.

Similarly, let $e_{1} \geqslant e_{2} \geqslant \cdots \geqslant e_{2 k}$ be the days of departure of the participants in non-increasing order (it is possible for a participant to arrive on day $b_{i}$ and leave on day $e_{j}$, where $i \neq j$).

If a participant arrives on day $b$ and leaves on day $e$, the number of coins they need to pay for staying at the hotel is $e-b+1$. Therefore, the total number of coins paid by all participants is
$$
\sum_{i=1}^{2 k} e_{i}-\sum_{i=1}^{2 k} b_{i}+2 k=\sum_{i=1}^{2 k}\left(e_{i}-b_{i}+1\right) \text {. }
$$

Before day $b_{i+1}$, at most $i$ participants have arrived at the competition site, so at most $\mathrm{C}_{i}^{2}$ matches have been played. This implies,
$$
b_{i+1} \leqslant \mathrm{C}_{i}^{2}+1 .
$$

Similarly, after day $e_{i+1}$, at most $\mathrm{C}_{i}^{2}$ matches have been played, so $e_{i+1} \geqslant \mathrm{C}_{2 k}^{2}-\mathrm{C}_{i}^{2}$. Hence, $e_{i+1}-b_{i+1}+1 \geqslant \mathrm{C}_{2 k}^{2}-2 \mathrm{C}_{i}^{2}$
$$
=k(2 k-1)-i(i-1) \text {. }
$$

This lower bound can be improved when $i>k$: for the list of the first $i$ participants to arrive and the list of the last $i$ participants to leave, $2 i-2 k$ participants appear in both lists, and the matches between these participants are counted twice. In fact, each pair of these participants only plays one match. Therefore, when $i>k$,
$$
\begin{array}{l}
e_{i+1}-b_{i+1}+1 \geqslant \mathrm{C}_{2 k}^{2}-2 \mathrm{C}_{i}^{2}+\mathrm{C}_{2 i-2 k}^{2} \\
=(2 k-i)^{2} .
\end{array}
$$

Below is a schedule that achieves the above lower bound simultaneously.

Divide all participants into two groups, $X$ and $Y$, each with $k$ participants. Divide the schedule into three parts:

1. The participants in group $X$ arrive at the competition site one by one, and each newly arrived participant immediately plays a match with each participant who has already arrived.
3. (After all participants in group $X$ have left the competition site) The participants in group $Y$ leave the competition site one by one, and each participant plays a match with each participant still at the competition site before leaving.
2. Each participant in group $X$ should play a match with each participant in group $Y$. Let $S_{1}, S_{2}, \cdots, S_{k}$ be the participants in group $X$, and $T_{1}, T_{2}, \cdots, T_{k}$ be the participants in group $Y$. The participants $T_{1}, T_{2}, \cdots, T_{k}$ arrive at the competition site in the following order: $T_{j}$ arrives and immediately plays a match with all participants $S_{i}(i>j)$.

Then, the participants $S_{k}, S_{k-1}, \cdots, S_{1}$ leave the competition site in the following order: each $S_{i}$ plays a match with all participants $T_{j}(i \leqslant j)$ before leaving, and the day $S_{k}$ leaves is the same day $T_{k}$ arrives.

For $0 \leqslant s \leqslant k-1$, the number of matches played between the arrival of participant $T_{k-s}$ and the departure of participant $S_{k-s}$ is
$$
\begin{array}{l}
\sum_{j=k-s}^{k-1}(k-j)+1+\sum_{j=k-s}^{k-1}(k-j+1) \\
=\frac{1}{2} s(s+1)+1+\frac{1}{2} s(s+3) \\
=(s+1)^{2} .
\end{array}
$$

Thus, if $i>k$, the number of matches played between the arrival of participant $T_{i-k+1}$ (day $b_{i+1}$) and the departure of participant $S_{i-k+1}$ (day $e_{i+1}$) is $(2 k-i)^{2}$, i.e.,
$$
e_{i+1}-b_{i+1}+1=(2 k-i)^{2} ;
$$

If $i \leqslant k$, all matches among the $i$ participants before day $b_{i+1}$ are in the first part of the schedule, so there are $\mathrm{C}_{i}^{2}$ matches, and $b_{i+1}=\mathrm{C}_{i}^{2}+1$.

Similarly, after day $e_{i+1}$, there are $i$ participants remaining, and all $\mathrm{C}_{i}^{2}$ matches among these $i$ participants are in the third part of the schedule, and $e_{i+1}=\mathrm{C}_{2 k}^{2}-\mathrm{C}_{i}^{2}$. Thus, for all $i \leqslant k$, the initial lower bound can be achieved.

In summary, all lower bounds can be achieved simultaneously, and such a schedule is indeed optimal.

Finally, the total number of coins paid for the optimal schedule is
$$
\begin{array}{l}
\sum_{i=0}^{k}(k(2 k-1)-i(i-1))+\sum_{i=k+1}^{2 k-1}(2 k-i)^{2} \\
=(k+1) k(2 k-1)-\sum_{i=0}^{k} i(i-1)+\sum_{j=1}^{k-1} j^{2} \\
=k(k+1)(2 k-1)-k^{2}+\frac{1}{2} k(k+1) \\
=\frac{1}{2} k\left(4 k^{2}+k-1\right) .
\end{array}
$$