I have got the following task:
Let us have $11$ positive integers, none of them with a prime divisor greater than $29$. Prove that we can always choose $a_1,\ldots,a_k$ and $b_1,\ldots,b_k$, where $b_i = 1$ or $2$ for all $i$, such that the product $a_1^{b_1} \cdots a_k^{b_k}$ is a cube.
I am not sure that it is understandable, here is an example I found:
If I have the number $12$ and $18$ in my list, I can choose $a_1 = 12, a_2 = 18$ and $b_1= 1, b_2 = 1 \rightarrow a_1^{b_1} a_2^{b_2} = 12^1 18^1 = 6^3$ is indeed a cube.
I just have no idea how to do the solving in general. Maybe it has something to do with the number of primes between $1$ and $29$: $\{2,3,5,7,11,13,17,19,23,29\}$, which is $10$ primes, and we have $11$ numbers, so we have at least $2$ numbers which have the same prime divisor, but how to go further?
Thanks in advance!