Three people lived together for the first five days, and the rent was shared equally every day, so it was 10 yuan per person per day. For five days, each of them will bear 50 yuan. So Xiao Wang paid 50 yuan and left. Xiao Gang and Xiao Liu each undertake 50 yuan.
From day 6 to day 10, there are only two people in the room, Xiao Gang and Xiao Liu each 15 yuan every day, and each person counts as 75 yuan. Xiao Gang paid 125 yuan (75+50 yuan) and left, and Xiao Liu took 125 yuan.
For the next 20 days, Xiao Liu lived alone. Every day in 30 yuan, 20 days * * * counted as 600 yuan, plus the 125 yuan that he had to bear in the previous 10 day, Xiao Liu had to pay 725 yuan.
The expenses were paid by three people respectively: Xiao Wang 50 yuan, Xiao Gang 125 yuan and Xiao Liu, 725 yuan. 900 yuan in all.