Grazing Donkey
Description:
The King and Queen of FarFarAway are going to pay Shrek and Fiona a visit at their swamp. However, Shrek is afraid that Donkey is going to be naughty again, so he decides to tie him up so he will not disturb the royal dinner. Shrek grows a circular patch of delicious grass, and decides to rope Donkey to a fence post on its border. However he's afraid that when Donkey gets hungry, he will eat all the grass, and Shrek needs the grass to prepare a dish of tasty ogre grass salad for the dinner. The rope needs to be short, so Donkey won't be able to eat (or, even worse, fertilize) too much grass.
Given the diameter of the circular grass patch (measured in ogre steps), calculate the maximum length of the rope so Donkey won't be able to eat more than given percentage of grass (given as ratio in range 0 <= percentage <= 1
, i.e. 0.5
means 50%). As Shrek is just an ogre and is not really familiar with fractions, the length should be returned as whole ogre steps. Beware: in the Fairy Land, grass patches can grow very large!
Stats:
Created | Jul 28, 2018 |
Published | Jul 29, 2018 |
Warriors Trained | 2261 |
Total Skips | 243 |
Total Code Submissions | 4425 |
Total Times Completed | 251 |
Java Completions | 48 |
JavaScript Completions | 59 |
Python Completions | 121 |
C# Completions | 24 |
Haskell Completions | 12 |
Factor Completions | 3 |
COBOL Completions | 6 |
C++ Completions | 17 |
Total Stars | 110 |
% of votes with a positive feedback rating | 97% of 67 |
Total "Very Satisfied" Votes | 63 |
Total "Somewhat Satisfied" Votes | 4 |
Total "Not Satisfied" Votes | 0 |
Total Rank Assessments | 7 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 6 kyu |