Snake
You’ve decided to create the game Snake. To do that the first task you decide to tackle is to fill the whole field with a snake - that would be the maximum possible score in the game.
Given two integers h
and w
, your program should print the field filled with the path of the snake.

Input | Output |
---|---|
4 10 |
|
Constraints
Time limit: 2 seconds
Memory limit: 512 MB
Output limit: 1 MB