We stayed in Munich for three nights and did a day trip to Salzburg which was fine.
Budapest - nights 1-3 (two full days)
Vienna - nights 4-6 (two full days)
Fly to Prague - nights 7 and 8 (one full day)
fly to Munich - nights 9, 10, 11, and 12 (three full days) - day trip to Salzburg.
That's a lot and I'd probably skip Prague, even though it's a favorite of mine. But it's just really out of the way.
Can you change where you fly in and out of? If you could, I'd say fly out of Prague and that way you can have Budapest, Vienna, Salzburg, and Munich all together, and then one flight to Prague.