To find the height you only have to substitute
and to find the time it took the hat to hit the ground you need to think a bit. If the hat is in the ground it means that de height is
we can use the formula for quadratics equations.
This solution is not possible because time can't be negative.