Let $x$ be any positive real number, and define a sequence $\{a_n\}_{n=1}^{\infty}$ by $$ a_n=\frac{[x]+[2x]+\cdots+[nx]}{n^2} $$ where $[x]$ is the largest integer less than or equal to $x$. Prove that $\{a_n\}_{n=1}^{\infty}$ converges to $\frac{x}{2}$.
I'm pretty stuck on this one. Any help would be greatly appreciated.