also if he had nothing to eat during those days
We see many scenes of Bruce's life on the streets. The first scene is him starving, but the scenes afterwards show him being rewarded for stopping a pickpocket, or committing crimes himself. While he wasn't committing crime for the financial gain, he can still have sustained himself off of it.
How did he maintain his body and remember all the previous physical training being in such hostile places?
Don't forget why Bruce went into exile in the first place. He specifically sought out to understand criminals, but as the prison scene shows, he also looks for criminals to fight.
That will definitely be a good workout.
From the script:
Ducard And when you left Gotham, what were you seeking?
Bruce To lose myself. I couldn’t do anything as Bruce Wayne. I felt useless.
Ducard You sought knowledge of the criminal world?
Bruce I needed to understand the thoughts and feelings of those who stand in the shadows. The first time you’re forced to steal not to starve you lose many
assumptions about the simple nature of right and wrong.
I needed to feel the fear before a crime, and the thrill of success, without becoming one of them. I thought I would find something. I thought I would learn what I needed to do with my skills and my anger.
But the harder I looked the less I know. Until I wasn't even sure what I'd been looking for in the first place. And I was lost.
During this explanation, there are many scenes taking place of Bruce's life in exile. But the last one is the most poignant: Bruce is arrested by the police, who are going to take him to prison. Bruce specifically states he's not a criminal, which the cop dismisses as he point out the crates he tried to steal - the crates are labeled as property of Wayne Enterprises.
Bruce intentionally let himself be incarcerated. He carries rage that he does not know how to act on. We then see him lure a criminal bully into a fight only to absolutely dominate him.
Fighting is good exercise.