Registration System c++ Time limit exceeded on test 7