Finish the fourth problem of hw2