Answer
A country will import a product if the world price is greater than its production price ( domestic price). A country will export a product for which it has a comparative advantage over the world price. Keep in mind that this can only occur if trade is allowed.
Work Step by Step
This is quite simple if it costs you less to produce something you will sell it. If it costs you more to produce it you will buy it from someone else.