As for how to get enough shares, it is nothing more than a high-priced acquisition. This price is not the company's assets (or net assets), but the psychological price at which the shareholders of Company B can sell their shares. How can company B be a listed company with extremely dispersed shareholders? After you have acquired more than 30% of the shares, you can make a compulsory takeover offer.
Of course, there are other possibilities. For example, the shares given to you by the shareholders of company B are very low, and you can get the shares without paying the money. Another example is that you participate in Company B, inject capital, and get enough shares after Company B expands its share capital.