Solve AOJ2502