Mock exam-portfolio management q 5

Can someone pls explain how the weights of the new portfolio are calculated?