Patent infringement problem

The conditions you gave are not comprehensive, and there are many situations that need to be considered whether there is infringement. Only in a broad sense.

The exhaustion of patent rights is relative to every patented product put on the market, so there are generally two situations based on whether there is infringement under the conditions you give:

If the products purchased and exported by B are not manufactured or licensed by A, then it is infringement.

If the products purchased and exported by B are manufactured or licensed by A, then the principle of exhaustion of patent rights can be applied.

It does not mean that as long as A sells a certain commodity in country A and country B, selling or importing other products with the same patent right does not constitute infringement.