(Reuters) - Drugstore chain Walgreens Boots Alliance Inc scrapped its deal to buy Rite Aid Corp after failing to win antitrust approval, but said it would instead buy nearly half of the smaller rival's U.S. stores for $5.18 billion.