5. Olya and Dima are playing a game. First, Olya lays out $2 n$ cards with numbers from 1 to $2 n$ in a row in some order. Then they take turns, starting with Dima. On each turn, a player takes one of the outer cards. What is the maximum number of consecutive numbers that Olya can collect, regardless of Dima's actions?
Answer: $n$ numbers. Olya should lay out the cards as follows: $1, n+1,2, n+2, \ldots, n-1,2 n-1, n, 2 n$. Olya will take cards from the same side as Dima. Then she will take (from the left) several numbers from $n+1$ in the larger direction, and (from the right) several numbers from $n$ in the smaller direction.