so what, no intelligent thoughts in this thread? i'd like to read them..
i'm forced to express my sparse thoughts: tessellation?
hexagonal tessellation? the cookie is in the center of the tile (the space between cookie can be taken in count), start from the center of the baking sheet and fill the whole. I'm not able to do this.
Another idea was related with figurative numbers but it is only worth to investigate for square baking sheets, not so frequent and the OP specified a rectangular shapes. You can enjoy figurative numbers in the
Tartaglia's triangle.
Then i tried something with
Text::Wrap with no brillant results.
Obviously you can think about cookies as an AoA and try to approximate the max row lenght and how many rows you'll need. you can even consider an element less for every even row to displace them in a diagonal like structure. But i think is a shaggy task of (square?) recursive approximations.
Or you can do as we do at home for cookies: place as they go and two or more waves of cooking!
L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.