Hi,
Your itinerary lends itself to one or two night train rides to max your days. The night train routes are: Munich to Berlin, Munich to Budapest, Berlin to Vienna, Budapest to Berlin, Budapest to Prague, Budapest to Krakow, For 19 days I'm sure you can rearrange your schedule to factor in one or 2 night train rides. That would help in your timing. I would also suggest dropping Split.
The cities on this itinerary are great for staying in hostels, lots of choices in Berlin, Budapest, Munich, Krakow, etc. esp the private independent ones, not those part of HI. Sometimes, if you reserve early enough, staying in a Pension is cheaper than a private room in a hostel. I stay in mostly Pensionen, be it 2 nights or close to 2 weeks in a city, and one or two nights at the hostel.
As for length of stay: Munich 2 nights, Berlin 4 nights if this is your first time there, Vienna 4 nights, Budapest 3 nights, Prague 2, Krakow 3,. Do a night train or two you can add an extra day to add..