On the solution of the distributed optimal control problem with time-periodic parabolic equations