Download benchmarks/math/circle_packing_rect/initial_program.py from JustinTX/sky2: direct link, hf CLI and curl.
- Browser
- Download file 551 Bytes
-
https://huggingface.co/JustinTX/sky2/resolve/main/benchmarks/math/circle_packing_rect/initial_program.py
- Command line
-
hf download hf://JustinTX/sky2/benchmarks/math/circle_packing_rect/initial_program.py
-
curl -L -o initial_program.py https://huggingface.co/JustinTX/sky2/resolve/main/benchmarks/math/circle_packing_rect/initial_program.py
551 Bytes
| # EVOLVE-BLOCK-START | |
| import numpy as np | |
| def circle_packing21() -> np.ndarray: | |
| """ | |
| Places 21 non-overlapping circles inside a rectangle of perimeter 4 in order to maximize the sum of their radii. | |
| Returns: | |
| circles: np.array of shape (21,3), where the i-th row (x,y,r) stores the (x,y) coordinates of the i-th circle of radius r. | |
| """ | |
| n = 21 | |
| circles = np.zeros((n, 3)) | |
| return circles | |
| # EVOLVE-BLOCK-END | |
| if __name__ == "__main__": | |
| circles = circle_packing21() | |
| print(f"Radii sum: {np.sum(circles[:,-1])}") | |