Solved AOJ 0202 and 0223 and PKU 1648