We have two grades of flour, one kilogram of which costs 31 tetri and 46 tetri, respectively. From them we have to make a mixture of 50 kg, one kilogram of which should cost 40 tetri. How many kilograms of flour should we take of each grade?

If you have x kg of 31 brand, then the rest (50-x) costs 46

So now just add up the cost of each part, and of the total.
31x + 46(50-x) = 40*50
Now finish it off