Calculations were made for a three-electrode magnetron-injector gun with a thermionic cathode for a relativistic gyrotron in the 300 GHz range, which provides the formation of a helical beam with an energy of 250 keV, a current of 100—300 A, and a pitch factor of 1.1. The possibility of generating radiation with a power of more than 8 MW in a gyrotron with a longitudinally slotted cavity has been shown within the framework of three-dimensional PIC-simulations.