#K72532. Rectangle Garden Positions
Rectangle Garden Positions
Rectangle Garden Positions
Given the dimensions of a rectangle, your task is to compute the coordinates of the four corners and the centers of its four sides. The rectangle has a length L and a width W. The four corners are defined as follows:
(C = {(0, W), (L, W), (L, 0), (0, 0)}),
and the centers of the sides are given by:
(M = {(\lfloor L/2 \rfloor, W), (L, \lfloor W/2 \rfloor), (\lfloor L/2 \rfloor, 0), (0, \lfloor W/2 \rfloor)}).
Print the eight coordinate pairs in the following order: top-left, top-right, bottom-right, bottom-left, top-center, right-center, bottom-center, and left-center. Note that integer (floor) division is used for determining the centers.
inputFormat
The input begins with an integer T, representing the number of test cases. Each test case consists of a single line containing two positive integers L and W, separated by a space, which denote the length and width of the rectangle respectively.
outputFormat
For each test case, output a single line containing eight coordinate pairs. Each pair is formatted as "x y" (without quotes), and pairs are separated by a comma and a space. See the sample outputs for clarification.## sample
1
12 8
0 8, 12 8, 12 0, 0 0, 6 8, 12 4, 6 0, 0 4
</p>