Feedback | If you notice incorrect translations in Contester, please let author know.
|
|
Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Difficulty Beta
There is a piece of cheese in a rectangle with the size of N x M .
Poor little mouse wants to eat the entire cheese. Starting at an arbitrary
cell, he is eating regular slices (1x1) of cheese, and then passes to the next
(Only if it has not eaten). Help small little mouse to
draw the route such that he eats all the cheese.
Input
In the first line the numbers N and M is given. (1 <= N , M <= 30).
Output
Withdraw the route as a sequence of a mouse coordinates
pieces, which he eats. Slices of cheese are the coordinates of
1 to N on the X, from 1 to M on Y axis.
Input b>
Td> tr>
2 2
Td> tr> |
Output b>
Td> tr>
1 1
2 1
2 2
1 2
Td> tr> | | |
Для отправки решений необходимо выполнить вход.
|