Solve several problems in pat OJ.