Bill is trying to plan a meal to meet specific nutritional goals. He wants to prepare a meal containing rice, tofu, and peanuts that will provide 240 grams of carbohydrates, 332 grams of fat, and 207 grams of protein. He knows that each cup of rice provides 40 grams of carbohydrates, 0 grams of fat, and 5 grams of protein. Each cup of tofu provides 4 grams of carbohydrates, 13 grams of fat, and 21 grams of protein. Finally, each cup of peanuts provides 26 grams of carbohydrates, 70 grams of fat, and 27 grams of protein. How many cups of rice, tofu, and peanuts should he eat?