{"id":"sphere-packing-cube-large","name":"Equal spheres in a cube (large n)","family":"combinatorics","description":"Place n spheres in the unit cube [0, 1]³ as large as possible (equal). Scored against the best-known Packomania records; anything above 1.0 on an n is a new record candidate.","metric":"record_ratio","direction":"maximize","tolerance":0.05,"eval_timeout_seconds":2400,"agent_timeout_seconds":3600,"mutable":["pack.py"],"runtime":"python>=3.11, standard library only (math, random, itertools, functools, collections, heapq, time)","decomposable":true,"status":"active","captain":null,"parent_problem":null,"program_md":"# Equal spheres in a cube (large n)\n\n## Goal\n\n`pack.py` exposes `pack(n: int, time_budget: float, seed: int) -> list[tuple[float, ...]]`: the\ncentres of `n` spheres inside the unit cube [0, 1]³ (3 coordinates each). All objects share one radius, which the eval derives as\n\n    r = min( distance of every centre to the boundary, half the smallest pairwise distance )\n\nYou do not return a radius; the eval derives the largest feasible one from your centres, so there\nis nothing to fudge. Make it as large as possible for every `n` you are handed.\n\n## Metric\n\nThe eval runs your `pack` on a fixed set of values, `n = 300, 500, 750, 1000, 1470, 2048, 2916, 5324, 7488, 9842`, each with the given time\nbudget (45 s by default), validates the result, and reports\n\n    metric = mean over n of  value(n) / record(n)\n\nwhere `record(n)` is the best-known value on Packomania (Eckard Specht's table, maintained since\n2011; table `scu`, fetched 2026-09-06). `1.0` matches the record; above `1.0` is a new record\ncandidate, listed under `records_beaten`. A hub-verified one is worth reporting to Packomania\nwith your ledger entry as provenance.\n\nThe hub verifies with a different `seed`, so your method must be robust to its starting point.\nThe full records table (n up to 19652) is in `eval.py`.\n\n## Constraints\n\n- Standard library only. No numpy, no scipy, no subprocess. The eval rejects other imports.\n- Respect `time_budget` (seconds, per call). The eval kills the run if the whole set overruns.\n- Deterministic given `seed`: use `random.Random(seed)`, not the global RNG.\n- Every centre must lie inside the container. Objects may touch; they may not overlap.\n\n## Large n\n\nThis is the large-n variant. Records here were mostly set by long offline optimisation runs, and that is a legitimate way to attack it: your `pack.py` may embed coordinates you found during your attempt (a stored configuration is a solver), as long as it returns them within the budget and the eval can derive the radius. The eval's overlap check is a cell list, so n = 10 000 is validated in seconds; your own local checks should do the same.\n\n## Where the frontier is\n\nonly small n are proven. Above that every entry is \"best known\", found by numerical search, and Packomania's\nhistory shows improvements landing mostly at larger `n`. Budget your time per `n` deliberately;\nthe O(n²) checks and the number of local optima both grow.\n\n## Ideas that are known to matter (check the journal before repeating one)\n\n- Energy minimisation: treat objects as repelling points, minimise a soft overlap penalty with\n  gradient descent, then polish by maximising the minimum scaled distance directly.\n- Basin hopping / perturb-and-repolish from the current best; keep a small population.\n- Start from structured arrangements (lattices, rings, shells) as well as random.\n- Identify the binding contacts and solve the equal-distance conditions exactly for the last digits.\n- Spend more of the budget on the `n` values whose ratio is lowest.\n\nWrite one honest line in `NOTES.md`: the idea, and which `n` it helped.\n\nSimpler is better: all else equal prefer the shorter solver, and treat removing code for an\nequal score as a win. Log every experiment, including discards, in your results.tsv.\n","eval_py":"\"\"\"Eval for sphere-packing-cube-large. Prints one JSON line: {\"metric\": record_ratio, ...}.\n\nGenerated by tools/packomania_import.py from https://packomania.com/scu/scu.html on 2026-09-06.\n\nEnv:\n  ZT_EVAL_SEED             seed handed to pack() (the n set is fixed so scores are comparable)\n  ZT_EVAL_NS               comma-separated n values (default \"300,500,750,1000,1470,2048,2916,5324,7488,9842\")\n  ZT_EVAL_PER_N_SECONDS    time budget handed to pack() per n (default 45)\n\"\"\"\n\nfrom __future__ import annotations\n\nimport ast\nimport itertools\nimport json\nimport math\nimport os\nimport random\nimport sys\nimport time\nfrom pathlib import Path\n\nSEED = os.environ.get(\"ZT_EVAL_SEED\", \"dev-seed\")\nNS = [int(x) for x in os.environ.get(\"ZT_EVAL_NS\", \"300,500,750,1000,1470,2048,2916,5324,7488,9842\").split(\",\")]\nBUDGET = float(os.environ.get(\"ZT_EVAL_PER_N_SECONDS\", \"45\"))\nSTDLIB_ALLOW = {\"math\", \"random\", \"itertools\", \"functools\", \"collections\", \"heapq\", \"time\", \"sys\", \"typing\", \"operator\"}\nEPS = 1e-9\nDIM = 3\n\n# Best-known values: equal objects in the unit cube [0, 1]³. Source: Packomania (E. Specht),\n# https://packomania.com/scu/scu.html, fetched 2026-09-06. only small n are proven.\nRECORDS = {\n    1: 0.500000000000000000000000000000, 2: 0.316987298107780676618138414624, 3: 0.292893218813452475599155637895, 4: 0.292893218813452475599155637895, 5: 0.263932022500210303590826331269,\n    6: 0.257359312880714853594933827371, 7: 0.250136153876702043245287439440, 8: 0.250000000000000000000000000000, 9: 0.232050807568877293527446341506, 10: 0.214285714285714285714285714286,\n    11: 0.207622238388108088730418254084, 12: 0.207106785524038967661929205346, 13: 0.207106781186547524400844362105, 14: 0.207106781186547524400844362105, 15: 0.192307692307692307692307692308,\n    16: 0.188796768447000008806390589866, 17: 0.188685238868306387497346180781, 18: 0.187680601147476864319898426192, 19: 0.183185303161713528511335899512, 20: 0.178407199722670498295402364957,\n    21: 0.177219044407182163032127767345, 22: 0.173273103227763925774353580229, 23: 0.171816783367860445192850051509, 24: 0.170540688701054438818560595676, 25: 0.167804075634883619081459335660,\n    26: 0.166905167286093734462460173062, 27: 0.166666666666666666666666666667, 28: 0.160191005918776726965553308878, 29: 0.160188620508520367600361869474, 30: 0.160188620508520367600361869474,\n    31: 0.160188620508520367600361869474, 32: 0.160188620508520367600361869474, 33: 0.154605431908113458803268257572, 34: 0.152117093470357826262144416884, 35: 0.151668522645211722883250253537,\n    36: 0.149378180763194405658757891822, 37: 0.149061631334124593491369826337, 38: 0.149038769067752685693797458665, 39: 0.147617379098483843586701989129, 40: 0.147058823529411764705882352941,\n    41: 0.144837878409323524702584699959, 42: 0.143045425138611931482588665745, 43: 0.141652316450780131858955961430, 44: 0.140860610937643660647157949944, 45: 0.140631937345523308925037746607,\n    46: 0.140246869718722237549525183737, 47: 0.139958859837643585218718460156, 48: 0.139958844038428028961026945453, 49: 0.136426759340618099952131723523, 50: 0.135954512641663590961947158274,\n    51: 0.135023077845862978090586437561, 52: 0.133820037890438853775788550699, 53: 0.133230838599655268343340284059, 54: 0.132203229521778740003053671001, 55: 0.131220272864170084341106694224,\n    56: 0.130661065057563874410482351159, 57: 0.130622145185501770981979216365, 58: 0.130602161880930003786122951566, 59: 0.130601937481870721257384103459, 60: 0.130601937481870721257384103459,\n    61: 0.130601937481870721257384103459, 62: 0.130601937481870721257384103459, 63: 0.130601937481870721257384103459, 64: 0.126743552193897270549733562135, 65: 0.126182631397946433581712956126,\n    66: 0.125739648702998446145768439109, 67: 0.124481087806075488201234438680, 68: 0.123435656366815640818905541847, 69: 0.123140054764804721591458806538, 70: 0.123037729238609389915888192279,\n    71: 0.123029495260108833411823691895, 72: 0.123027579246856645375052517365, 73: 0.121787558898588281805759130210, 74: 0.121338760477507576980121392507, 75: 0.121321447243951955120787808530,\n    76: 0.120183555428448647905536180377, 77: 0.119055120033309745814179732258, 78: 0.118546035457300935508803608738, 79: 0.118014005111223125177457028297, 80: 0.117788131720054479915866130763,\n    81: 0.117097826866012569527637211147, 82: 0.116833115824453777868360608909, 83: 0.11628516041895784, 84: 0.116283622527162899015929568587, 85: 0.116283622527162899015929568587,\n    86: 0.116283622527162899015929568587, 87: 0.116283622527162899015929568587, 88: 0.115521432463999509608513951182, 89: 0.113769756020378567236974295678, 90: 0.113282348330133080002307754446,\n    91: 0.112825882631227847852400102019, 92: 0.112501402436970813748889460007, 93: 0.112377874545726467438435800962, 94: 0.112059610672800520390188722519, 95: 0.111760641276069087137149634920,\n    96: 0.11165576298837838, 97: 0.111549039238116230729755354203, 98: 0.111518995642259881967158256699, 99: 0.111387457101684639571115939167, 100: 0.111382347512479750227357863499,\n    101: 0.110240604605984488395300868556, 102: 0.110240604605881656306005409178, 103: 0.110240604605771200956705296110, 104: 0.110240604605771200956705296110, 105: 0.110240604605771200956705296110,\n    106: 0.110240604605771200956705296110, 107: 0.110240604605771200956705296110, 108: 0.110240604605771200956705296110, 109: 0.10803724109568319, 110: 0.107351687751265221334223234275,\n    111: 0.106941670183376412904632662949, 112: 0.106596144936939921438574825419, 113: 0.106015030670236449830990992236, 114: 0.105638674774892988622921118486, 115: 0.105139320062404106634646927986,\n    116: 0.105020769143720196890610392111, 117: 0.104862565393023965043484822020, 118: 0.104825223479775015134210424464, 119: 0.104807213897334002029276796620, 120: 0.104799209238670891294951835980,\n    121: 0.104794644945186055341346762105, 122: 0.104794644945186055341346762105, 123: 0.103655560572363307031575018437, 124: 0.103565408824050712230139389617, 125: 0.103553925066206716915127434881,\n    126: 0.103553390593732956500974495913, 127: 0.102723333417229152714722854241, 128: 0.102138048910691342601202762193, 129: 0.101709768385088817517685820617, 130: 0.101487077912810691846749147351,\n    131: 0.101237761497258212945052271073, 132: 0.101004698586467635391056777841, 133: 0.100848081101034105657200605205, 134: 0.100303030810527955518235877015, 135: 0.100027526024665806632751402773,\n    136: 0.099942293733514072837410275287, 137: 0.099901055976293947387122828593, 138: 0.099869136132138274608992147122, 139: 0.099861438323195858408472239585, 140: 0.099861423765742509347086675908,\n    141: 0.099861423765734035957354474049, 142: 0.099861423765734035957354474049, 143: 0.099861423765734035957354474049, 144: 0.099861423765734035957354474049, 145: 0.098210363369124150758679237155,\n    146: 0.097707634021058723871414777599, 147: 0.097451041461791270165635326911, 148: 0.097080745870995323158328346808, 149: 0.096842620692390056917098886508, 150: 0.096699818947909231860508484243,\n    151: 0.096476176420636419602948412010, 152: 0.096389285595133841500852081701, 153: 0.096348281670196208918791969036, 154: 0.096174724217719596161558763080, 155: 0.095854018689526566316929256947,\n    156: 0.095769693873542219648246404441, 157: 0.095690301364806875730441024640, 158: 0.095543431930241454854174465868, 159: 0.095526509975699479261865048920, 160: 0.095463733045255628946582570420,\n    161: 0.095420001747936516364270819029, 162: 0.095420001747936516364270819029, 163: 0.095371784915273092541325475666, 164: 0.095371784915273092541325475666, 165: 0.095371784915273092541325475666,\n    166: 0.095371784915273092541325475666, 167: 0.095371784915273092541325475666, 168: 0.095371784915273092541325475666, 169: 0.095371784915273092541325475666, 170: 0.095371784915273092541325475666,\n    171: 0.095371784915273092541325475666, 172: 0.095371784915273092541325475666, 173: 0.093528698827363598509201662614, 174: 0.093181416471697888883900208731, 175: 0.093048532236911075031229300528,\n    176: 0.092858339933078515004139442135, 177: 0.092615580532447051981757473651, 178: 0.091955372480144976121787033421, 179: 0.091686938711758539127998824763, 180: 0.091671057985988438718806599233,\n    181: 0.091456254037620172344038418162, 182: 0.091357879295255647004839788690, 183: 0.091339177427463474092882007077, 184: 0.091329194647921544844470560211, 185: 0.091286523040278795923789760358,\n    186: 0.091278114789098602759994208311, 187: 0.091274171854317298220098683792, 189: 0.091268473841496235833376468338, 190: 0.091268473841496235833376468338, 191: 0.090378285157880331098009360860,\n    192: 0.090325874743793710920918910795, 193: 0.090325523878516853367662463973, 194: 0.090325523878515125761215675691, 195: 0.090325523878514499188176358112, 196: 0.090325523878396330706130694737,\n    197: 0.089417584894103704095909456994, 198: 0.089158071887012628885608586488, 199: 0.088891929159565430468993340363, 200: 0.088716570465074727117909134091, 201: 0.088534834881382586158121911806,\n    202: 0.088290466561289724252310690484, 203: 0.088145402159111815614755208049, 204: 0.088052458334153019016876489464, 205: 0.087962482520026674920562501209, 206: 0.087644814758193457760554681234,\n    207: 0.087581767936455166233443588628, 208: 0.087540276202190177543304169543, 209: 0.087503683912438055850054848183, 210: 0.087503682910749560248412119492, 211: 0.087503682910749560248412119492,\n    212: 0.087503682910749560248412119492, 213: 0.087503682910749560248412119492, 214: 0.087503682908881810115315868393, 215: 0.087503682908881810115315868393, 216: 0.087503682908881810115315868393,\n    217: 0.087503682908881810115315868393, 218: 0.087503682908881810115315868393, 219: 0.087503682908881810115315868393, 220: 0.087503682908881810115315868393, 221: 0.086206896551724137931034482759,\n    222: 0.085971933187901880257805461771, 223: 0.085613896481777002396440800748, 224: 0.085540274707322778639730838873, 225: 0.085354352973450812864982074648, 226: 0.085269223062915779612269717610,\n    227: 0.085034010703683219219999492152, 228: 0.084952453825830348617982443077, 229: 0.084857415519077175758513646933, 230: 0.084812296348066652220021432291, 231: 0.084708658645209141137057363258,\n    232: 0.084697693184805359758256013447, 233: 0.084433222069069809403212250606, 234: 0.084302226617522519790247182142, 235: 0.084064520641598906709317976325, 236: 0.084043100678280830990229678362,\n    237: 0.084038839471294785961531272692, 238: 0.084038839284553382052836941778, 239: 0.084037180490575441288788941646, 240: 0.084037180189667230560130160281, 241: 0.084037180176720218933477820468,\n    242: 0.084037180176719844059700224143, 243: 0.084037180176719844059700224143, 244: 0.084037180176719844059700224143, 245: 0.084037180176719844059700224143, 246: 0.084037180176719844059700224143,\n    247: 0.084037180176719844059700224143, 248: 0.084037180176719844059700224143, 249: 0.084037180176719844059700224143, 250: 0.084037180176719844059700224143, 251: 0.084037180176719844059700224143,\n    252: 0.084037180176719844059700224143, 253: 0.084037180176719844059700224143, 254: 0.084037180176719844059700224143, 255: 0.084037180176719844059700224143, 256: 0.084037180176719844059700224143,\n    257: 0.082527504292618341051027570166, 258: 0.082385217229284069879859871562, 259: 0.081686224084967096256587036420, 260: 0.081610296303517543617682726270, 261: 0.081596290127681588622854530304,\n    262: 0.081490012742793835502699956699, 263: 0.081471606698261301703736388743, 264: 0.081425027827779404737821919383, 265: 0.081423875886960539783560762498, 266: 0.081368049334066504689625470634,\n    267: 0.081367527611385156252518463385, 268: 0.081367527279796722164999515718, 269: 0.081367527046974026631769391643, 270: 0.081367527046974026631769391643, 271: 0.080835024571833994970081368335,\n    272: 0.080834877244731118528615245616, 273: 0.080834866396550408247950183953, 274: 0.080834866020369643608501735087, 275: 0.080834866004961682854823368538, 276: 0.080834866004961666546042334547,\n    277: 0.080834866004961666546042334547, 278: 0.080834866004961666546042334547, 279: 0.080834866004961666546042334547, 280: 0.080834866004961666546042334547, 281: 0.080118082209242188895002863686,\n    282: 0.080095032622724402421759861133, 283: 0.080094455611204171827421134465, 284: 0.080094310254260183800180934737, 285: 0.080094310254260183800180934737, 286: 0.080094310254260183800180934737,\n    287: 0.080094310254260183800180934737, 288: 0.080094310254260183800180934737, 289: 0.079393902903793907763044708029, 290: 0.079238473966394828804857182130, 291: 0.078988534570263456674838023420,\n    292: 0.078881225884637349819627659323, 293: 0.078718360578596175853311003598, 294: 0.078551256357215726984561387218, 295: 0.078420695008447931477717228443, 296: 0.078316049336618362762985761257,\n    297: 0.078244322182918851379931904266, 298: 0.078173753658183601523684982837, 299: 0.078101357041745923588089718237, 300: 0.077965173253348842499387295373, 301: 0.077933236860295269744791572580,\n    302: 0.077915787692273278737670885179, 303: 0.077904467857220204438465918203, 304: 0.077880541154185232181769992525, 305: 0.077871564126633249065902706758, 306: 0.077867872516684092391984012355,\n    307: 0.077867850308463427268897200603, 308: 0.077867686413296911700675461502, 309: 0.077867678032973660549594457854, 310: 0.077867647571910772613619109192, 311: 0.077867647557479485638070742613,\n    312: 0.077867647557479122127321967326, 313: 0.077867647557479019928881136957, 314: 0.077867647557479019928881136957, 315: 0.077867647557479019928881136957, 316: 0.077867647557479019928881136957,\n    317: 0.077867647557479019928881136957, 318: 0.077867647557479019928881136957, 319: 0.077867647557479019928881136957, 320: 0.077867647557479019928881136957, 321: 0.076859330225149447080888493618,\n    322: 0.076512697794024640465526783893, 323: 0.076275780453944911633726104416, 324: 0.076252955403894430534696044427, 325: 0.076172988135351425257370023048, 326: 0.076114463792118009471495923983,\n    327: 0.075927701640076310200110967689, 328: 0.075750024517167159518512388236, 329: 0.075675510271348878610110287896, 330: 0.075652168339158149744613921034, 331: 0.075651838670568089735796779112,\n    332: 0.075485773612752219576366990660, 333: 0.075422691957489727484054464283, 334: 0.075266496599373693282509100648, 335: 0.075218572782176960140785659089, 336: 0.075184403131255429233238464341,\n    337: 0.075153625385474711212948161838, 338: 0.075110552968500220044699434771, 339: 0.075110552968500220044699434771, 340: 0.075110552968500220044699434771, 341: 0.075110552849287136244701715643,\n    342: 0.075110552672538310042663471109, 343: 0.075110552599345772370410572172, 344: 0.075110552474119092672016633722, 345: 0.075110552423098779486372466522, 346: 0.075110552411167428771986540449,\n    347: 0.075110552411167422503334756401, 348: 0.075110552411167422503334756401, 349: 0.075110552411167422503334756401, 350: 0.075110552411167422503334756401, 351: 0.075110552411167422503334756401,\n    352: 0.075110552411167422503334756401, 353: 0.075110552411167422503334756401, 354: 0.075110552411167422503334756401, 355: 0.075110552411167422503334756401, 356: 0.075110552411167422503334756401,\n    357: 0.075110552411167422503334756401, 358: 0.075110552411167422503334756401, 359: 0.075110552411167422503334756401, 360: 0.075110552411167422503334756401, 361: 0.075110552411167422503334756401,\n    362: 0.075110552411167422503334756401, 363: 0.075110552411167422503334756401, 364: 0.075110552411167422503334756401, 365: 0.075110552411167422503334756401, 366: 0.073810174502530158802224957191,\n    367: 0.073797534219264991169648941335, 368: 0.073697412701078851978835899432, 369: 0.073388041735188005644783779637, 370: 0.073291442629992562149413449669, 371: 0.073188366735143782555117207598,\n    372: 0.073035948215124336514178042911, 373: 0.072919061086295782886848511839, 374: 0.072876823233514892006320918540, 375: 0.072824493994813126816767458221, 376: 0.072774856844876871907030791489,\n    377: 0.072707539269157607276043902597, 378: 0.072631493542294257366555778333, 379: 0.072625629337726752276057844060, 380: 0.072618298063524750164974085776, 381: 0.072602761039647635020744633649,\n    382: 0.072592061319951150430913283434, 383: 0.072581452498237565174178151049, 384: 0.072567561288004418506194720883, 385: 0.072542024034581654580005481314, 386: 0.072542024034581654580005481314,\n    387: 0.072542024034581654580005481314, 388: 0.072542024034581654580005481314, 389: 0.072542024034581654580005481314, 390: 0.072542024034581654580005481314, 391: 0.072542024034581654580005481314,\n    392: 0.072542024034581654580005481314, 393: 0.072542024034581654580005481314, 394: 0.072542024034581654580005481314, 395: 0.072542024034581654580005481314, 396: 0.071947120237510712408186429063,\n    397: 0.071945537256208178615694104153, 398: 0.071945073441456722522535836116, 399: 0.071945061380559186566364458797, 400: 0.071945060202581284653802695969, 401: 0.071945060202581284653802695969,\n    402: 0.071945060202581284653802695969, 403: 0.071945060202581284653802695969, 404: 0.071945060202581284653802695969, 405: 0.071945060202581284653802695969, 406: 0.071241993138176325932171085471,\n    407: 0.071130322805698538272163318811, 408: 0.070992448068156701461893944647, 409: 0.070991564178933683120821324353, 410: 0.070991272199943838693008325019, 411: 0.070973281192139507043666205283,\n    412: 0.070957708618189570440615910867, 413: 0.070957693075395617530064181489, 414: 0.070957693073984724365265571802, 415: 0.070957693072547251836538973586, 416: 0.070957693072547251836538973586,\n    417: 0.070204504909258696342749745563, 418: 0.070194314169082584473825209554, 419: 0.070178609131427696516928232098, 420: 0.070161380755595517002652053433, 421: 0.070149601658402254084409477330,\n    422: 0.070145041311433888009469040274, 423: 0.070145016455215633626200819404, 424: 0.070144644854034555594075033520, 425: 0.070143808392582071665756411702, 426: 0.070143422957718679990525241081,\n    427: 0.070143375115102636610257098060, 428: 0.070143357040350618394021064201, 429: 0.070143357040350618394021064201, 430: 0.070143357040350618394021064201, 431: 0.070143357040350618394021064201,\n    432: 0.070143357040350618394021064201, 433: 0.070143357040350618394021064201, 434: 0.070143357040350618394021064201, 435: 0.070143357040350618394021064201, 436: 0.070143357040350618394021064201,\n    437: 0.070143357040350618394021064201, 438: 0.070143357040350618394021064201, 439: 0.070143357040350618394021064201, 440: 0.070143357040350618394021064201, 441: 0.070143357040350618394021064201,\n    442: 0.070143357040350618394021064201, 443: 0.070143357040350618394021064201, 444: 0.070143357040350618394021064201, 445: 0.070143357040350618394021064201, 446: 0.069233707128270654399847077984,\n    447: 0.069030087174172597925743583090, 448: 0.068838267795163094850024530435, 449: 0.068623602598840452244579924835, 450: 0.068542686994751602207258028788, 451: 0.068517920228119345654987157839,\n    452: 0.068435893541902267074114947452, 453: 0.068412409343810927519787460216, 454: 0.068341869291713795021871870160, 455: 0.068174537920728724138078989328, 456: 0.068102938032336874219110677506,\n    457: 0.067963401353968999525663017244, 458: 0.067898277368984974203189249300, 459: 0.067898260382033117077868016483, 460: 0.067898259154772755107088975938, 461: 0.067898243557164725160629267997,\n    462: 0.067898243026801550458802643024, 463: 0.067898242902700012642578768542, 464: 0.067898241371008870375602787458, 465: 0.067898240894994114816995303736, 466: 0.067898240894769256234850175248,\n    467: 0.067898240894769256234850175248, 468: 0.067898240894769256234850175248, 469: 0.067898240894733926027528729528, 470: 0.067898240894670536184764825826, 471: 0.067898240894670536184764825826,\n    472: 0.067898240894670536184764825826, 473: 0.067898240894669987626645237290, 474: 0.067898240894669971134273408341, 475: 0.067898240894669971134273408341, 476: 0.067898240894669971134273408341,\n    477: 0.067898240894669971134273408341, 478: 0.067898240894669971134273408341, 479: 0.067898240894669971134273408341, 480: 0.067898240894669971134273408341, 481: 0.067898240894669971134273408341,\n    482: 0.067898240894669971134273408341, 483: 0.067898240894669971134273408341, 484: 0.067898240894669971134273408341, 485: 0.067898240894669971134273408341, 486: 0.067898240894669971134273408341,\n    487: 0.067898240894669971134273408341, 488: 0.067898240894669971134273408341, 489: 0.067898240894669971134273408341, 490: 0.067898240894669971134273408341, 491: 0.067898240894669971134273408341,\n    492: 0.067898240894669971134273408341, 493: 0.067898240894669971134273408341, 494: 0.067898240894669971134273408341, 495: 0.067898240894669971134273408341, 496: 0.067898240894669971134273408341,\n    497: 0.067898240894669971134273408341, 498: 0.067898240894669971134273408341, 499: 0.067898240894669971134273408341, 500: 0.067898240894669971134273408341, 501: 0.066002499421194550624945936232,\n    502: 0.065971995835096955155134994482, 503: 0.065953407656910457976819787973, 504: 0.065938979127592539925136800846, 505: 0.065934616827670016308410003378, 506: 0.065933169696594152001873988945,\n    507: 0.065932119200351706079281328718, 508: 0.065914877023449751534297966710, 509: 0.065904966615631596711192727963, 510: 0.065896596763521537635417404885, 511: 0.065885179839799297213511143839,\n    512: 0.065876710792833133445599616784, 513: 0.065857618868492604075531008701, 514: 0.065853271375579009049038578656, 515: 0.065851125435528253274262156040, 516: 0.065849653956777260663487494187,\n    517: 0.065843466833670366596953724978, 518: 0.065841843966186986901744331019, 519: 0.065840194009219518877977402842, 520: 0.065832881910204159608303612943, 521: 0.065822608498266152671124629697,\n    522: 0.065816231276463394553107046100, 523: 0.065813345551118658903171320852, 524: 0.065810571424743381165317067846, 525: 0.065808682558683034273685636583, 526: 0.065808126501346132975896679898,\n    527: 0.065807267279778471088956124787, 528: 0.065799555215404468420595481583, 529: 0.065796506936974803604271815946, 530: 0.065792388537428188054400687228, 531: 0.065792388537428188054400687228,\n    532: 0.065792388537428188054400687228, 533: 0.065792388537428188054400687228, 534: 0.065792388537428188054400687228, 535: 0.065792388537428188054400687228, 536: 0.065792388537428188054400687228,\n    537: 0.065792388537428188054400687228, 538: 0.065792388537428188054400687228, 539: 0.065300968740935360628692051729, 540: 0.065300968740935360628692051729, 541: 0.065300968740935360628692051729,\n    542: 0.065300968740935360628692051729, 543: 0.065300968740935360628692051729, 544: 0.065300968740935360628692051729, 545: 0.065300968740935360628692051729, 546: 0.065300968740935360628692051729,\n    547: 0.065300968740935360628692051729, 548: 0.065300968740935360628692051729, 549: 0.065300968740935360628692051729, 550: 0.065300968740935360628692051729, 551: 0.064841541239626698338988413837,\n    552: 0.064764530598075684788649623627, 553: 0.064507278189934705891660557872, 554: 0.064275105732295168679723966283, 555: 0.064178706409216872616584993158, 556: 0.064113080941624506035399730795,\n    557: 0.064099379933789090892574162280, 558: 0.064086733261772610703982565526, 559: 0.064077088711980582093904814067, 560: 0.064072270593712096843276020085, 561: 0.064038824228626521467734760328,\n    562: 0.064027702835710455496421588410, 563: 0.063997253319530737651451516078, 564: 0.063993721172506368450657595430, 565: 0.063993721172506368450657595430, 566: 0.063993721172506368450657595430,\n    567: 0.063993721172506368450657595430, 568: 0.063928591292801360309477404631, 569: 0.063916647912608868695899179299, 570: 0.063894413220094973169222611575, 571: 0.063883688344204093881928603868,\n    572: 0.063877800629663622300913534174, 573: 0.063825431502544478269635619614, 574: 0.063815916317669040654743095320, 575: 0.063813380743178769710723962314, 576: 0.063813299435606545921370374939,\n    577: 0.063813286191663588031887753007, 578: 0.063813232741589656659483312260, 579: 0.063813232033093370989790283867, 580: 0.063813232033087612094331974915, 581: 0.063813232033087541882319517721,\n    582: 0.063813232033087345054964559607, 583: 0.063813232033085846303279006235, 584: 0.063813232033085825787209549822, 585: 0.063813232033085825787209549822, 586: 0.063813232033085825787209549822,\n    587: 0.063813232033085825787209549822, 588: 0.063813232033085825787209549822, 589: 0.063813232033085825787209549822, 590: 0.063813232033085825787209549822, 591: 0.063813232033085825787209549822,\n    592: 0.063813232033085825787209549822, 593: 0.063813232033085825787209549822, 594: 0.063813232033085825787209549822, 595: 0.063813232033085825787209549822, 596: 0.063813232033085825787209549822,\n    597: 0.063813232033085825787209549822, 598: 0.063813232033085825787209549822, 599: 0.063813232033085825787209549822, 600: 0.063813232033085825787209549822, 601: 0.062797016946445163282811404177,\n    602: 0.062766685063556315287911682777, 603: 0.062765988427004737037220065467, 604: 0.062750741995934676976202828007, 605: 0.062677588485932542697967223225, 606: 0.062671605429717208039275555091,\n    607: 0.062573992666848107412476682949, 608: 0.062529768921599535434215072497, 609: 0.062446054289784178934571046751, 610: 0.062392332879195797860039380962, 611: 0.062318918393343243614686104038,\n    612: 0.062245534540559901170595269096, 613: 0.062213620288693763292194242562, 614: 0.062130066824710321694039744598, 615: 0.062110673516382532167144455314, 616: 0.062046276836597830419678517310,\n    617: 0.062000948268256292599087010854, 618: 0.061958659090464511104337047053, 619: 0.061949901846019073538089026141, 620: 0.061949677939758711987750961308, 621: 0.061949672150758547244108222900,\n    622: 0.061949672150758547244108222900, 623: 0.061949672150758547244108222900, 624: 0.061949671933904385820568372577, 625: 0.061949671933904385820568372577, 626: 0.061949671575576253101582412052,\n    627: 0.061949671562752377338255254847, 628: 0.061949671562752377338255254847, 629: 0.061949671555858822095077778259, 630: 0.061949671549657821193834961183, 631: 0.061949671549657821193834961183,\n    632: 0.061949671549647706571514730827, 633: 0.061949671549647706571514730827, 634: 0.061949671549647706571514730827, 635: 0.061949671549647706571514730827, 636: 0.061949671549647706571514730827,\n    637: 0.061949671549647706571514730827, 638: 0.061949671549647706571514730827, 639: 0.061949671549647706571514730827, 640: 0.061949671549647706571514730827, 641: 0.061949671549647706571514730827,\n    642: 0.061949671549647706571514730827, 643: 0.061949671549647706571514730827, 644: 0.061949671549647706571514730827, 645: 0.061949671549647706571514730827, 646: 0.061949671549647706571514730827,\n    647: 0.061949671549647706571514730827, 648: 0.061949671549647706571514730827, 649: 0.061949671549647706571514730827, 650: 0.061949671549647706571514730827, 651: 0.061949671549647706571514730827,\n    652: 0.061949671549647706571514730827, 653: 0.061949671549647706571514730827, 654: 0.061949671549647706571514730827, 655: 0.061949671549647706571514730827, 656: 0.061949671549647706571514730827,\n    657: 0.061949671549647706571514730827, 658: 0.061949671549647706571514730827, 659: 0.061949671549647706571514730827, 660: 0.061949671549647706571514730827, 661: 0.061949671549647706571514730827,\n    662: 0.061949671549647706571514730827, 663: 0.061949671549647706571514730827, 664: 0.061949671549647706571514730827, 665: 0.061949671549647706571514730827, 666: 0.061949671549647706571514730827,\n    667: 0.060646739335517307812446345765, 668: 0.060615915806494546783203742812, 669: 0.060598218134957951246404102678, 670: 0.060583629869387875366148049352, 671: 0.060561745199243631835072719088,\n    672: 0.060539105099612028667929187308, 673: 0.060536779317784512258365772528, 674: 0.060518962287604899472148626836, 675: 0.060509904683154657578733854372, 676: 0.060493299377578445036236539968,\n    677: 0.060475934636548219151131916319, 678: 0.060421169466225890650477759733, 679: 0.060417018648301931339267688767, 680: 0.060392988442166306274367327997, 681: 0.060377232528843577711999481314,\n    682: 0.060313129109733103109029868159, 683: 0.060289244513501583126386417518, 684: 0.060227237082535876777889045209, 685: 0.060191867073540742067103420653, 686: 0.060191867073540742067103420653,\n    687: 0.060191867073540742067103420653, 688: 0.060191867073540742067103420653, 689: 0.060191867073540742067103420653, 690: 0.060191867073540742067103420653, 691: 0.060191867073540742067103420653,\n    692: 0.060191867073540742067103420653, 693: 0.060191867073540742067103420653, 694: 0.060191867073540742067103420653, 695: 0.060191867073540742067103420653, 696: 0.060191867073540742067103420653,\n    697: 0.060191867073540742067103420653, 698: 0.060191867073540742067103420653, 699: 0.060191867073540742067103420653, 700: 0.060191867073540742067103420653, 701: 0.060191867073540742067103420653,\n    702: 0.060191867073540742067103420653, 703: 0.060191867073540742067103420653, 704: 0.060191867073540742067103420653, 705: 0.060191867073540742067103420653, 706: 0.060191867073540742067103420653,\n    707: 0.060191867073540742067103420653, 708: 0.060191867073540742067103420653, 709: 0.060191867073540742067103420653, 710: 0.060191867073540742067103420653, 711: 0.060191867073540742067103420653,\n    712: 0.059780288091492160542569852862, 713: 0.059780288091492160542569852862, 714: 0.059780288091492160542569852862, 715: 0.059780288091492160542569852862, 716: 0.059780288091492160542569852862,\n    717: 0.059780288091492160542569852862, 718: 0.059780288091492160542569852862, 719: 0.059780288091492160542569852862, 720: 0.059780288091492160542569852862, 721: 0.059780288091492160542569852862,\n    722: 0.059780288091492160542569852862, 723: 0.059780288091492160542569852862, 724: 0.059780288091492160542569852862, 725: 0.059780288091492160542569852862, 726: 0.059780288091492160542569852862,\n    727: 0.058742069061895289913172736513, 728: 0.058717280483190052832989968956, 729: 0.058659720173699229604117241598, 730: 0.058636886104586061002102372750, 731: 0.058595440459740292066085178673,\n    732: 0.058531226258185347923785573032, 733: 0.058531064606729197904556991356, 734: 0.058531064606618489087859209965, 735: 0.058531064606618489087859209965, 736: 0.058531064606618489087859209965,\n    737: 0.058531064606618489087859209965, 738: 0.058531064606618489087859209965, 739: 0.058531064606460477616596983880, 740: 0.058531064606434406548529962253, 741: 0.058531064606434406548529962253,\n    742: 0.058531064606434406548529962253, 743: 0.058531064606434406548529962253, 744: 0.058531064606383841251155892942, 745: 0.058531064606349411277370825254, 746: 0.058531064606349411277370825254,\n    747: 0.058531064606349411277370825254, 748: 0.058531064606349411277370825254, 749: 0.058531064606312360652617583659, 750: 0.058531064606309995663691230586, 751: 0.058531064606270936722148169744,\n    752: 0.058531064606270936722148169744, 753: 0.058531064606270936722148169744, 754: 0.058531064606270936722148169744, 755: 0.058531064606270936722148169744, 756: 0.058531064606270936722148169744,\n    757: 0.058531064606270936722148169744, 758: 0.058531064606270936722148169744, 759: 0.058531064606270936722148169744, 760: 0.058531064606270936722148169744, 761: 0.058531064606270936722148169744,\n    762: 0.058531064606270936722148169744, 763: 0.058531064606270936722148169744, 764: 0.058531064606270936722148169744, 765: 0.058531064606270936722148169744, 766: 0.058531064606270936722148169744,\n    767: 0.058531064606270936722148169744, 768: 0.058531064606270936722148169744, 769: 0.058531064606270936722148169744, 770: 0.058531064606270936722148169744, 771: 0.058531064606270936722148169744,\n    772: 0.058531064606270936722148169744, 773: 0.058531064606270936722148169744, 774: 0.058531064606270936722148169744, 775: 0.058531064606270936722148169744, 776: 0.058531064606270936722148169744,\n    777: 0.058531064606270936722148169744, 778: 0.058531064606270936722148169744, 779: 0.058531064606270936722148169744, 780: 0.058531064606270936722148169744, 781: 0.058531064606270936722148169744,\n    782: 0.058531064606270936722148169744, 783: 0.058531064606270936722148169744, 784: 0.058531064606270936722148169744, 785: 0.058531064606270936722148169744, 786: 0.058531064606270936722148169744,\n    787: 0.057589005447075341007033535483, 788: 0.057515302753686151119318472507, 789: 0.057515302753686151119318472507, 790: 0.057498654206606746878816500585, 791: 0.057452205749238243596185626847,\n    792: 0.057365811216482482817408133377, 793: 0.057356312222008810279000968621, 794: 0.057356312222008707705264984053, 795: 0.057356312222008685492265170878, 796: 0.057356312222008685492265170878,\n    797: 0.057356312222008685492265170878, 798: 0.057356312222008685492265170878, 799: 0.057356312222008669309225735683, 800: 0.057356312222008669309225735683, 801: 0.057069268186840375740526806975,\n    802: 0.057055411748154953230562086726, 803: 0.057043037901732207475443304360, 804: 0.057030074202568724297952592237, 805: 0.057020707254359809737224278698, 806: 0.056998038726805455918700419099,\n    807: 0.056993183936507771807010201798, 808: 0.056992119514288443071593588896, 809: 0.056991835237605583666387710450, 810: 0.056985204349746179788122177130, 811: 0.056962601890588273032970877791,\n    812: 0.056959450361781703936212504060, 813: 0.056959450361781703936212504060, 814: 0.056959450361781703936212504060, 815: 0.056959450361781703936212504060, 816: 0.056959450361781703936212504060,\n    817: 0.056959450361781703936212504060, 818: 0.056959450361781703936212504060, 819: 0.056959450361781703936212504060, 820: 0.056959450361781703936212504060, 821: 0.056959450361781703936212504060,\n    822: 0.056959450361781703936212504060, 823: 0.056959450361781703936212504060, 824: 0.056959450361781703936212504060, 825: 0.056959450361781703936212504060, 826: 0.056959450361781703936212504060,\n    827: 0.056959450361781703936212504060, 828: 0.056959450361781703936212504060, 829: 0.056959450361781703936212504060, 830: 0.056959450361781703936212504060, 831: 0.056959450361781703936212504060,\n    832: 0.056959450361781703936212504060, 833: 0.056959450361781703936212504060, 834: 0.056959450361781703936212504060, 835: 0.056959450361781703936212504060, 836: 0.056959450361781703936212504060,\n    837: 0.056959450361781703936212504060, 838: 0.056959450361781703936212504060, 839: 0.056959450361781703936212504060, 840: 0.056959450361781703936212504060, 841: 0.056959450361781703936212504060,\n    842: 0.056959450361781703936212504060, 843: 0.056959450361781703936212504060, 844: 0.056959450361781703936212504060, 845: 0.056959450361781703936212504060, 846: 0.056959450361781703936212504060,\n    847: 0.056959450361781703936212504060, 848: 0.056959450361781703936212504060, 849: 0.056959450361781703936212504060, 850: 0.056959450361781703936212504060, 851: 0.056959450361781703936212504060,\n    852: 0.056959450361781703936212504060, 853: 0.056959450361781703936212504060, 854: 0.056959450361781703936212504060, 855: 0.056959450361781703936212504060, 856: 0.056959450361781703936212504060,\n    857: 0.056959450361781703936212504060, 858: 0.056959450361781703936212504060, 859: 0.056959450361781703936212504060, 860: 0.056959450361781703936212504060, 861: 0.056959450361781703936212504060,\n    862: 0.056959450361781703936212504060, 863: 0.056959450361781703936212504060, 864: 0.056959450361781703936212504060, 865: 0.056156773481307844658496053043, 866: 0.056154991435925812537449412137,\n    867: 0.056140201356690653283231385138, 868: 0.056128012575057355280636431019, 869: 0.056106912473384981671269525184, 870: 0.056071806417837649423518430642, 871: 0.055949689012166998852504362332,\n    872: 0.055797709737818520954404934931, 873: 0.055759822943043844867261140129, 874: 0.055733670838415080213518668538, 875: 0.055716324325719934748361094866, 876: 0.055698446850663686946609710769,\n    877: 0.055688027900021744326379410706, 878: 0.055663055758705725099353009481, 879: 0.055644148592601269984039631904, 880: 0.055644148446431840738504768261, 881: 0.055609934599387289434184941416,\n    882: 0.055592226301537126202514510074, 883: 0.055541080512676902017145268078, 884: 0.055518541079436331451335847978, 885: 0.055492923046045800317630476676, 886: 0.055470027839216034700251427886,\n    887: 0.055470027839216034700251427886, 888: 0.055470027839216034700251427886, 889: 0.055470027839216034700251427886, 890: 0.055470027839216034700251427886, 891: 0.055470027839216034700251427886,\n    892: 0.055470027839216034700251427886, 893: 0.055470027839216034700251427886, 894: 0.055470027839216034700251427886, 895: 0.055470027839216034700251427886, 896: 0.055470027839216034700251427886,\n    897: 0.055470027839216034700251427886, 898: 0.055470027839216034700251427886, 899: 0.055470027839216034700251427886, 900: 0.055470027839216034700251427886, 901: 0.055470027839216034700251427886,\n    902: 0.055470027839216034700251427886, 903: 0.055470027839216034700251427886, 904: 0.055470027839216034700251427886, 905: 0.055470027839216034700251427886, 906: 0.055470027839216034700251427886,\n    907: 0.055470027839216034700251427886, 908: 0.055470027839216034700251427886, 909: 0.055470027839216034700251427886, 910: 0.055470027839216034700251427886, 911: 0.055470027839216034700251427886,\n    912: 0.055470027839216034700251427886, 913: 0.055470027839216034700251427886, 914: 0.055470027839216034700251427886, 915: 0.055470027839216034700251427886, 916: 0.055470027839216034700251427886,\n    917: 0.055470027839216034700251427886, 918: 0.055470027839216034700251427886, 919: 0.055120302302885600478352648055, 920: 0.055120302302885600478352648055, 921: 0.055120302302885600478352648055,\n    922: 0.055120302302885600478352648055, 923: 0.055120302302885600478352648055, 924: 0.055120302302885600478352648055, 925: 0.055120302302885600478352648055, 926: 0.055120302302885600478352648055,\n    927: 0.055120302302885600478352648055, 928: 0.055120302302885600478352648055, 929: 0.055120302302885600478352648055, 930: 0.055120302302885600478352648055, 931: 0.055120302302885600478352648055,\n    932: 0.055120302302885600478352648055, 933: 0.055120302302885600478352648055, 934: 0.055120302302885600478352648055, 935: 0.055120302302885600478352648055, 936: 0.055120302302885600478352648055,\n    937: 0.054056513690627580830230868286, 938: 0.054056513690627580830230868286, 939: 0.054056513690627580830230868286, 940: 0.054056513690627580830230868286, 941: 0.054056513690627580830230868286,\n    942: 0.054056513690627580830230868286, 943: 0.054056513690627580830230868286, 944: 0.054056513690627580830230868286, 945: 0.054056513690627580830230868286, 946: 0.054056513690627580830230868286,\n    947: 0.054056513690627580830230868286, 948: 0.054056513690627580830230868286, 949: 0.054056513690627580830230868286, 950: 0.054056513690627580830230868286, 951: 0.054056513690627580830230868286,\n    952: 0.054056513690627580830230868286, 953: 0.054056513690627580830230868286, 954: 0.054056513690627580830230868286, 955: 0.054056513690627580830230868286, 956: 0.054056513690627580830230868286,\n    957: 0.054056513690627580830230868286, 958: 0.054056513690627580830230868286, 959: 0.054056513690627580830230868286, 960: 0.054056513690627580830230868286, 961: 0.054056513690627580830230868286,\n    962: 0.054056513690627580830230868286, 963: 0.054056513690627580830230868286, 964: 0.054056513690627580830230868286, 965: 0.054056513690627580830230868286, 966: 0.054056513690627580830230868286,\n    967: 0.054056513690627580830230868286, 968: 0.054056513690627580830230868286, 969: 0.054056513690627580830230868286, 970: 0.054056513690627580830230868286, 971: 0.054056513690627580830230868286,\n    972: 0.054056513690627580830230868286, 973: 0.054056513690627580830230868286, 974: 0.054056513690627580830230868286, 975: 0.054056513690627580830230868286, 976: 0.054056513690627580830230868286,\n    977: 0.054056513690627580830230868286, 978: 0.054056513690627580830230868286, 979: 0.054056513690627580830230868286, 980: 0.054056513690627580830230868286, 981: 0.054056513690627580830230868286,\n    982: 0.054056513690627580830230868286, 983: 0.054056513690627580830230868286, 984: 0.054056513690627580830230868286, 985: 0.054056513690627580830230868286, 986: 0.054056513690627580830230868286,\n    987: 0.054056513690627580830230868286, 988: 0.054056513690627580830230868286, 989: 0.054056513690627580830230868286, 990: 0.054056513690627580830230868286, 991: 0.054056513690627580830230868286,\n    992: 0.054056513690627580830230868286, 993: 0.054056513690627580830230868286, 994: 0.054056513690627580830230868286, 995: 0.054056513690627580830230868286, 996: 0.054056513690627580830230868286,\n    997: 0.054056513690627580830230868286, 998: 0.054056513690627580830230868286, 999: 0.054056513690627580830230868286, 1000: 0.054056513690627580830230868286, 1001: 0.054056513690627580830230868286,\n    1002: 0.054056513690627580830230868286, 1003: 0.054056513690627580830230868286, 1004: 0.054056513690627580830230868286, 1005: 0.054056513690627580830230868286, 1006: 0.054056513690627580830230868286,\n    1007: 0.054056513690627580830230868286, 1008: 0.054056513690627580830230868286, 1099: 0.052713249114356128822606565812, 1183: 0.051134288434088697065568920205, 1372: 0.049056216499551603695874112020,\n    1470: 0.047685892457636546270662737833, 1568: 0.046887633244705559531752168694, 1575: 0.046162924657103347039408406899, 1596: 0.045873685240266316193875366337, 1688: 0.045873685240266316193875366337,\n    1920: 0.043293734875191244236409689974, 2048: 0.043078931469947142896917782204, 2304: 0.041397560998312734340720700619, 2457: 0.040605151570806143269344526747, 2916: 0.038400053241015010156147575456,\n    3240: 0.037058394198732015901015497519, 3430: 0.036422118202974706332966455024, 4000: 0.034637963349705857837370592980, 4400: 0.033542564328622267345928227575, 4631: 0.033020441265655654492504741814,\n    5324: 0.031547249213935075199129229167, 5808: 0.030636040487610355896877739627, 6084: 0.030199894576979347586760531050, 6912: 0.028962914548938506757532106885, 7488: 0.028193060798872112820501662180,\n    7813: 0.027823280049611743180523109217, 8788: 0.026769935039588584446261812284, 9842: 0.025793436662982545451664619310, 10976: 0.024885671378317445885588442609, 12195: 0.024039628993891727216398519359,\n    13500: 0.023249221280583883441745514304, 14896: 0.022509135228949249144794355081, 16384: 0.021814713469012485147472549766, 17969: 0.021161856162396791370672230516, 19652: 0.020546939999223613896253784682,\n}\n\n\ndef fail(msg: str, kind: str = \"error\") -> None:\n    print(json.dumps({\"metric\": 0.0, \"error\": msg, \"kind\": kind}))\n    sys.exit(1)\n\n\ndef check_imports(path: Path) -> None:\n    try:\n        tree = ast.parse(path.read_text(encoding=\"utf-8\"))\n    except SyntaxError as e:\n        fail(f\"syntax error in pack.py: {e}\", \"compile_error\")\n    for node in ast.walk(tree):\n        names = []\n        if isinstance(node, ast.Import):\n            names = [a.name.split(\".\")[0] for a in node.names]\n        elif isinstance(node, ast.ImportFrom) and node.module:\n            names = [node.module.split(\".\")[0]]\n        for nm in names:\n            if nm not in STDLIB_ALLOW:\n                fail(f\"import of '{nm}' is not allowed (stdlib subset only: {sorted(STDLIB_ALLOW)})\", \"compile_error\")\n\n\ndef boundary(c) -> float:\n    \"\"\"Distance from centre c to the container boundary; negative outside.\"\"\"\n    return min(c[0], 1 - c[0], c[1], 1 - c[1], c[2], 1 - c[2])\n\n\ndef weight(i: int) -> float:\n    \"\"\"Radius weight of object i (1-based); the eval derives the common scale s, r_i = weight(i) * s.\"\"\"\n    return 1.0\n\n\ndef value_of(centres: list, n: int) -> float:\n    if not isinstance(centres, (list, tuple)) or len(centres) != n:\n        fail(f\"pack({n}) must return {n} centres\", \"wrong_answer\")\n    pts = []\n    for c in centres:\n        try:\n            p = tuple(float(v) for v in c)\n        except Exception:\n            fail(f\"pack({n}) returned a non-point {c!r}\", \"wrong_answer\")\n        if len(p) != DIM or not all(math.isfinite(v) for v in p):\n            fail(f\"pack({n}) returned a point that is not {DIM}-D and finite: {c!r}\", \"wrong_answer\")\n        if boundary(p) < -EPS:\n            fail(f\"pack({n}) placed a centre outside the container: {p}\", \"wrong_answer\")\n        pts.append(p)\n    w = [weight(i + 1) for i in range(n)]\n    s = min(max(boundary(p), 0.0) / w[i] for i, p in enumerate(pts))   # upper bound from the walls\n    if s <= EPS:\n        fail(f\"pack({n}) has a centre on the boundary (scale={s})\", \"wrong_answer\")\n    # Any pair that limits the scale below s has distance < (w_i + w_j) s <= 2 wmax s, so it lies\n    # in the same or an adjacent cell of a grid with that spacing. Expected O(n) instead of O(n^2).\n    cell = 2.0 * max(w) * s\n    grid = {}\n    for idx, p in enumerate(pts):\n        key = tuple(int(math.floor(v / cell)) for v in p)\n        grid.setdefault(key, []).append(idx)\n    offsets = list(itertools.product((-1, 0, 1), repeat=DIM))\n    for key, members in grid.items():\n        for off in offsets:\n            nb = tuple(k + o for k, o in zip(key, off))\n            if nb < key or nb not in grid:\n                continue\n            others = grid[nb]\n            for i in members:\n                pi = pts[i]\n                for j in others:\n                    if nb == key and j <= i:\n                        continue\n                    pj = pts[j]\n                    d = math.sqrt(sum((a - b) * (a - b) for a, b in zip(pi, pj))) / (w[i] + w[j])\n                    if d < s:\n                        s = d\n    if s <= EPS:\n        fail(f\"pack({n}) has coincident centres (scale={s})\", \"wrong_answer\")\n    return w[n - 1] * s   # the largest object's radius (equal case: the common radius)\n\n\ndef main() -> None:\n    here = Path(__file__).parent\n    check_imports(here / \"pack.py\")\n    sys.path.insert(0, str(here))\n    try:\n        import pack as cand  # noqa: E402\n    except SystemExit:\n        raise\n    except Exception as e:\n        fail(f\"import pack.py failed: {e!r}\", \"compile_error\")\n    if not hasattr(cand, \"pack\"):\n        fail(\"pack.py must define pack(n, time_budget, seed)\", \"compile_error\")\n\n    ns = sorted(set(NS))\n    for n in ns:\n        if n not in RECORDS:\n            fail(f\"no Packomania record for n={n}\", \"error\")\n    seed_int = random.Random(f\"scu|{SEED}\").getrandbits(32)\n    per_n, beaten = {}, []\n    t_all = time.perf_counter()\n    for n in ns:\n        t0 = time.perf_counter()\n        try:\n            centres = cand.pack(n, BUDGET, seed_int)\n        except SystemExit:\n            raise\n        except Exception as e:\n            fail(f\"pack({n}) raised {e!r}\", \"runtime_error\")\n        elapsed = time.perf_counter() - t0\n        if elapsed > 1.25 * BUDGET + 3:\n            fail(f\"pack({n}) took {elapsed:.1f}s against a {BUDGET:.0f}s budget\", \"timeout\")\n        v = value_of(centres, n)\n        ratio = v / RECORDS[n]\n        per_n[n] = {\"value\": round(v, 12), \"record\": RECORDS[n], \"ratio\": round(ratio, 6), \"seconds\": round(elapsed, 2)}\n        if v > RECORDS[n] + 1e-9:\n            beaten.append(n)\n    metric = sum(x[\"ratio\"] for x in per_n.values()) / len(per_n)\n    print(json.dumps({\"metric\": round(metric, 6), \"ns\": ns, \"per_n\": per_n, \"records_beaten\": beaten,\n                      \"total_seconds\": round(time.perf_counter() - t_all, 1)}))\n\n\nif __name__ == \"__main__\":\n    main()\n","baseline":{"pack.py":"\"\"\"Baseline: a lattice of candidate points inside the container, spacing found by bisection so\nthat at least n fit. Deliberately naive; scores well below the records. Beat it.\"\"\"\n\nimport itertools\nimport math\n\nDIM = 3\n\n\ndef _boundary(c):\n    return min(c[0], 1 - c[0], c[1], 1 - c[1], c[2], 1 - c[2])\n\n\ndef _weight(i):\n    return 1.0\n\n\ndef _lattice(n, r):\n    \"\"\"Cubic lattice points at spacing 2r whose distance to the boundary is at least r.\"\"\"\n    lo, hi = ((0.0,) * DIM, (1.0,) * DIM)\n    step = 2.0 * r\n    axes = []\n    for d in range(DIM):\n        k = int((hi[d] - lo[d]) / step) + 1\n        axes.append([lo[d] + r + i * step for i in range(k)])\n    pts = [p for p in itertools.product(*axes) if _boundary(p) >= r]\n    return pts\n\n\ndef pack(n, time_budget, seed):\n    # treat every object as the largest one when choosing the lattice spacing\n    wmax = max(_weight(i + 1) for i in range(n))\n    # find a feasible spacing by halving, then bisect between it and the last infeasible one\n    a = 1.0\n    while len(_lattice(n, a * wmax)) < n and a > 1e-9:\n        a /= 2\n    b = 2 * a\n    for _ in range(40):\n        m = (a + b) / 2\n        if len(_lattice(n, m * wmax)) >= n:\n            a = m\n        else:\n            b = m\n    pts = _lattice(n, a * wmax)\n    pts.sort(key=lambda p: -_boundary(p))   # keep the most interior points\n    return [tuple(p) for p in pts[:n]]\n"}}