The total momentum of the system has to be conserved to satisfy the principle of conservation of momentum. Before the ball hits the bottle, the momentum of the system is 0.4 x 18 = 7.2 kg m/s
The momentum of the bottle after being hit is 0.2 x 25 = 5 kg m/s
So the momentum of the ball now is 7.2 - 5 = 2.2 kg m/s
Hence its velocity is 2.2/0.4 = 5.5 m/s