The design of a 390 GHz gyrotron based on a cusp electron gun