Explanation:
Spain's opportunity cost of producing a pound of cheese is
= 4 barrels of oil
Austria's opportunity cost of producing a pound of cheese is
= 10 barrels of oil
Spain's opportunity cost of producing a barrel of oil is
= 
= 0.25
Austria's opportunity cost of producing a barrel of oil is
= 
= 0.1
A country is said to be having a comparative advantage in the production of a commodity if it has a relatively lower opportunity cost of production.
Here, Spain has a lower opportunity cost of producing cheese, so it has a comparative advantage in producing cheese.
Similarly, Austria has a lower opportunity cost of producing oil, so it has a comparative advantage in producing oil.
Spain can gain from trade as long as it is getting more than 4 barrels of oil for a pound of cheese.
While Austria can gain from trade as long as it is getting more than 0.125 pounds of cheese for a barrel of oil.
Both will gain from trade if the price of the trade is 9 barrels of oil per pound of cheese and 7 barrels of oil per pound of cheese.
Spain will not accept 1 barrel of oil per pound of cheese and Austria will not pay 16 barrels of oil per pound of cheese.