Did you run it against the sample input? If you do that, you’ll see that your output differs from the expected output.
You do realise that each test case consists of two integers?
Edit: this was written before khoaph corrected the problem reference and title from RETO7 to RETO1.