Solved AOJ 0257, 0259, 0576, 0587, 2489 and 2490