I posted this question on Math StackExchange but did not get any answer. I am trying my luck here.

Let $n,k$ be give postive integers and $n>k$. If for all real numbers $x$ we have $$A_{1}cos{x}+A_{2}cos{(2x)}+cdots+A_{n}cos{(nx)}le 1$$

Find the maximum value of $A_{k}$.

I don’t know if this question has been studied

If $n=2.3$ it is easy to solve it.