A particle is projected vertically upwards from a point O on horizontal ground which reaches the maximum height Q. What is the energy associated at O and Q?

at O where h = 0, all kinetic,

E= (1/2)m Vi^2 + 0
at Q, not moving any more
E =0 + m g Q

Total energy during whole trip
E = (1/2)m v^2 + m g h
as h goes up to Q, v goes down to 0

using the start and finish points
(1/2) m V^2 = m g Q
Vi^2 = 2 g Q
Vi = sqrt(2gQ)