5. (6 points) A canteen bought 500 kilograms of rice and 200 kilograms of flour. After eating for some time, it was found that the amount of rice and flour consumed was the same, and the remaining rice was exactly 7 times the remaining flour. How many kilograms of rice and flour were consumed each?