When you look at this, you might not be sure which way to divide ...
Should you divide 6 by 5 or 5 by 6 ?
Here's a case where you can use your units to decide.
The question wants to know the 'period'. That's a length of time,
so the answer needs to have units of time.
If you divide 'cycles' be 'time', you'll get 'cycles/second'.
That's Hz. It's frequency, not time.
If you divide 'time' by 'cycles', you'll get 'seconds/cycle'.
That's time, and it's exactly the definition of 'period'.
Period = (6 seconds) / (5 cycles)
= (6 / 5) seconds/cycle
= 1.2 seconds
The expression commonly used for potential gravitational energy is just simplification. It is actually just the first term in Taylor expansion of the real expression.
In general, the potential energy of gravitational field is defined as:

Where G is universal gravitational constant, and r is the distance between the objects centers of mass. Negative sign represents the bound state.
Since we are not given the mass of the planet we have to calculate it.

This formula can be used for any planet. It gives you the gravitational acceleration on the planet's surface. We can use it to calculate the planet's mass:

Now we can calculate the potential energy of that cannonball when it reaches its maximum height.

When we plug in the numbers we get:

The potential energy has to be equal to the kinetic energy.