2. Given the set $A=\{k+1, k+2, \cdots, k+n\}, k, n$ are positive integers, if the sum of all elements in set $A$ is 2019, then when $n$ takes the maximum value, the set $A=$
If $n$ is odd, $n k+\frac{n(n+1)}{2}=n\left(k+\frac{n+1}{2}\right)=2019=3 \times 673 \Rightarrow n=3$; if $n$ is even, $n k+\frac{n(n+1)}{2}=\frac{n}{2}(2 k+n+1)=2019 \Rightarrow n=6, k=333$. Therefore, the set $A=\{334,335,336,337,338,339\}$.