2.2 KiB
id | challengeType | title | forumTopicId |
---|---|---|---|
5900f4a71000cf542c50ffb9 | 5 | Problem 314: The Mouse on the Moon | 301970 |
Description
The bigger countries of course have built a 2000 m wall enclosing the entire 250 000 m2 area. The Duchy of Grand Fenwick, has a tighter budget, and has asked you (their Royal Programmer) to compute what shape would get best maximum enclosed-area/wall-length ratio.
You have done some preliminary calculations on a sheet of paper. For a 2000 meter wall enclosing the 250 000 m2 area the enclosed-area/wall-length ratio is 125. Although not allowed , but to get an idea if this is anything better: if you place a circle inside the square area touching the four sides the area will be equal to π2502 m2 and the perimeter will be π500 m, so the enclosed-area/wall-length ratio will also be 125.
However, if you cut off from the square four triangles with sides 75 m, 75 m and 75√2 m the total area becomes 238750 m2 and the perimeter becomes 1400+300√2 m. So this gives an enclosed-area/wall-length ratio of 130.87, which is significantly better.
Find the maximum enclosed-area/wall-length ratio. Give your answer rounded to 8 places behind the decimal point in the form abc.defghijk.
Instructions
Tests
tests:
- text: <code>euler314()</code> should return 132.52756426.
testString: assert.strictEqual(euler314(), 132.52756426);
Challenge Seed
function euler314() {
// Good luck!
return true;
}
euler314();
Solution
// solution required