Magic rectangles --- Introduction ---

A magic square is a table of n rows and n columns, filled by numbers 1, 2, ..., n 2, such that the sums of each row and each column are equal Magic rectangles is a variation of this principle.
Set up

you are before a table of and , with a given number at the side of each row and each column.

Your goal is to fill this table using the numbers 1, 2, ...,rows×columns, so that the of each row and each column equals the corresponding given number. And of course no number can be used twice.

And you should solve each problem within .

This page is not in its usual appearance because WIMS is unable to recognize your web browser.
In order to access WIMS services, you need a browser supporting forms. In order to test the browser you are using, please type the word wims here: and press ``Enter''.

Please take note that WIMS pages are interactively generated; they are not ordinary HTML files. They must be used interactively ONLINE. It is useless for you to gather them through a robot program.