Royals score nine runs, hold on to beat Padres 9-7