you can cover Budapest, Prague, Vienna, Munich easily in a 10 day trip. An excellent site to plan your itinerary is Rome2Rio - it gives you connections between cities via all modes (flight, train, car/bus) so you can optimise your travel time and budget. 2-3 days for each city is good to cover all major tourist attractions - rest up to you to spend more time in a particular place.
Also in a tightly packed multi country Europe trip - an overnight train/bus is an excellent way to save on time and an extra hotel night cost! Most of the trains and buses are super comfy and luxurious- so keep that option open vs just going for flights