A cannon, placed in the valley, fires a shell at 31 degree with respect to the horizontal line. the initial speed of the shell is 512 m/s. Find the time it takes the shell to hit the ground. Calculate the range of the shell (the horizontal distance traveled by the shell).