Sujet : Re: How to Make Cisterns
De : rjh (at) *nospam* cpax.org.uk (Richard Heathfield)
Groupes : rec.puzzlesDate : 03. May 2025, 14:30:41
Autres entêtes
Organisation : Fix this later
Message-ID : <vv55q1$3jq94$1@dont-email.me>
References : 1 2 3
User-Agent : Mozilla Thunderbird
On 03/05/2025 13:19, David Entwistle wrote:
On Sat, 3 May 2025 11:07:57 +0100, Richard Heathfield wrote:
.....I cheated, and after this spoiler I offer an answer to the nearest
micron.
In your last couple of entries, approaching an answer, the side changes by
30% and the volume changes by very little (less than 0.001%). I think
something as gone off track somewhere.
Nope. Rather than post a million results, I only posted the incremental improvements:
include <stdio.h>
int main(void)
{
int i;
int ms = 0;
int mv = 0;
for(i = 0; i < 1000000; i++)
{
int s = 1000000 - i;
int v = s * s * s;
if(v > mv)
{
ms = s;
mv = v;
printf("Side = %d microns, volume = %d cubic microns.\n", s, v);
}
}
return 0;
}
[Aside to Richard Tobin - yes, I should have used long ints. Sue me.]
If you can recall high-school calculus, then the answer falls out as a
simple fraction.
I can recall passing the exam, and the answer falls out as...um... 1000000-357737 remaining=642263 removed, so the squares that were removed were each 642263/2=321131 microns on a side.
The simple fraction is therefore
321131
-------
1000000
but that's probably not what you meant.
"Easily" was my immediate reaction... but then I thought about it, and
decided that it... well, that it's a far better question than it looks.
My initial reaction was "no", but then I began to have doubts. I'll give
it a go.
Are we allowed to use offcuts to patch holes? I'm not saying I plan to try, but it strikes me that it would do no harm to ensure that the ground rules are the same for everybody.
-- Richard HeathfieldEmail: rjh at cpax dot org dot uk"Usenet is a strange place" - dmr 29 July 1999Sig line 4 vacant - apply within