eolymp
bolt
Try our new interface for solving problems
Problems

Dual lattice

Dual lattice

Two infinite uniform rectangular lattice given cell size and \textbf{x_1}x\textbf{y_1} \textbf{x_2}x\textbf{y_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 \textbf{D_x} in the horizontal and vertical \textbf{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. \InputFile In the first row are the numbers \textbf{x_1}, \textbf{y_1}, \textbf{x_2}, \textbf{y_2}, \textbf{D_x}, \textbf{D_y}, separated by spaces. \textbf{1} ≤ \textbf{x_1}, \textbf{y_1}, \textbf{x_2}, \textbf{y_2} ≤ \textbf{100}. \textbf{0} ≤ \textbf{D_x} < \textbf{x_1}, \textbf{0} ≤ \textbf{D_y} < \textbf{y_1}, все числа целые. \OutputFile The first line of output \textbf{N} - number of squares resulting in the following \textbf{N} lines - the area themselves.
Time limit 1 second
Memory limit 64 MiB
Input example #1
20 20 12 10 2 0
Output example #1
4
20
60
100
120