It's not just the welfare state that makes this possible, it's maybe more so the fact that (as far as I understand) Germany has a functioning housing market, and Berlin especially is very cheap for such a big city.
In many parts of Europe housing costs would have killed you.