solved AOJ0270