Let, $\pi_k(x)$ denote the number of $n\le x$ with $k$-prime factors (not necessarily distinct). Using the Sieve of Eratostheness, show that, $$\pi_k(x) \le \frac{x(A\log \log x+B)^k}{k! \log x}.$$ for some positive constants $A$ and $B$.
Im unable to start the problem, as I can not write $\pi_k(x)$ is in compact form. If a number $N$ has $k$-prime factors (not necessarily distinct) means if $N=p_1^{r_1}p_2^{r_2}\cdots p_t^{r_t}$ then $r_1+r_2+\cdots +r_t=k$. So how can I write $\pi_k(x)$ in compact form ? Any hint.?