There's a nighttrain, departing from Malmö Central and arriving in Berlin.
Between the 24th of August and the 29th of September, the train is operated and departs from Malmö Central Wednesday - Sunday and it departs from Berlin Every Monday and then from thursday 'til sunday.
I mean, take the Sunday train, arrive there on Monday morning and then spend a day in Berlin and explore. I'm sure there are lots of cheap hostels in Berlin. And well, there goes daily trains from Berlin to Magdeburg pretty often (I've looked that up) so it's just to take an early train on the tuesday and then you can head to EF.
The prices for the Berlin Night ExpressIf you want to share with five other people in a bed-compartment with 6 beds it's 450 swedish kronor
If you want to share a bed-compartment with just one peep, it's 900 swedish kronor.
450 SEK(Swedish kronor) = 331 DKK (Danish Kronor) = 44.50 EUR = 384 NOK (Norwegian Kronor)
900 SEK = 663 DKK = 89 EUR = 769 NOK
For more information, here's the webpage.
http://www.berlin-night-express.com/