Solve No.4 and No.5 problems.