Solved AOJ 0258, 0262 and 2438