Dual lattice
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Two infinite uniform rectangular lattice given cell size and x_1xy_1 x_2xy_2. Lattice are located on planes parallel to each other and coordinate axes so that the displacement of one of the nodes in the second grating with respect to the first node of D_x in the horizontal and vertical D_y. As a result, overlay, a new "composite" grid with smaller cells of different sizes. Want to display in ascending order of all the different areas of cells composite lattice.
Input
In the first row are the numbers x_1, y_1, x_2, y_2, D_x, D_y, separated by spaces.
1 ≤ x_1, y_1, x_2, y_2 ≤ 100. 0 ≤ D_x < x_1, 0 ≤ D_y < y_1, все числа целые.
Output
The first line of output N - number of squares resulting in the following N lines - the area themselves.
Examples
Input #1
Answer #1
Submissions 101
Acceptance rate 38%