Yes, Here you will only get the answer with using $x=A\cos{wt}$, Because your question mentioned that, In the first $t$ seconds the body moves distance $a$ and in the next $t$ seconds it moves distance $ 2a$. This is possible only if the body is left from an extreme position and moving towards the center. Because at the center, the body in SHM has the highest kinetic energy and hence will travel a greater distance in the same time interval. when left from the center the body in SHM will travel less distance in equal interval of time
In SHM, if the body starts moving from center, one uses $x=A\sin{wt}$ as at\ $ t=0, x=0.$
when the body starts moving from extreme position we use $x= A\cos{wt} $ as at $ t =\frac{\pi}{2}, x=0 $
In very general one uses $x=A\sin{wt}+B\cos{wt}$ and the initial condition tells you which one you have to pick up ($sin(x),\ cos(x) \ or\ combination\ of\ sin(x)\ and\ cos(x)$).
for instance if you are leaving the particle from extreme then at $t=0\ x= C (say) $ (I know it will be B)$\ and\ at \ t=pi/2 , x=0 $ and that implies A=0.{see by putting $t=\frac{\pi}{2} $}