Problem G
Greener Tuborg
Languages
da
de
en
To secure future investment capital, your brewery has decided to improve their Environmental, Social, and Governance (ESG) score by signalling allegiance to the UN Global Goals for Sustainable Development. You have been made Sustainability Commissar.
The first thing you will improve is the suboptimal packaging of beer cans into crates. These are currently arranged in a grid-like pattern like this:
The area for such a $p\times q$ packing is $4\cdot p\cdot q$, if we assume that the cans have unit radius. In the above example, the area is $4\cdot 3\cdot 5 = 60$.
This consumes resources in the form of wrapping materials, wastes energy for cooling storage space, and emits carbon dioxide during transportation. Surely there is a smarter, greener solution! Any solution that saves at least an area of $\frac{1}{100}$ will do. For instance, the $15$ cans in the above example are more sustainably packed like this:
It can be checked that the area of this crate is $8\cdot (4 + 2\sqrt{3}) \leq 60 -\frac{1}{100}$, as promised.
Input
The number $N$ of cans, with $14\leq N\leq 100$.
Output
Print $N+1$ lines. The first line contains the width $w$ and height $h$ of the crate, with $w \cdot h\leq 4 \cdot N - \frac{1}{100}$. The following $N$ lines each contain the coordinates of a single can; the can’s position is given by its centre coordinates $(x,y)$ with $1\leq x\leq w-1$ and $1\leq y\leq h-1$. No two points can be at Euclidean distance strictly less than $1.9999998$.
Sample Input 1 | Sample Output 1 |
---|---|
15 |
8 7.464101615137754 1 1 3 1 5 1 7 1 1 3 3 3 5 3 7 3 1 6.464101615137754 3 6.464101615137754 5 6.464101615137754 7 6.464101615137754 2 4.732050807568877 4 4.732050807568877 6 4.732050807568877 |