Opportunity cost refers to the highest valued option forgone. There will not have any impact on opportunity cost of BankX. It is because the opportunity cost of Bank X to takeover Bank Y shares is 5millions. And the action of taking over is a chosen option not the higest valued option forgone.