Q5 Solution of First problem