4 kyu

Grazing Donkey

48 of 251hobovsky

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.

Grass patch

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!

Geometry
Performance

Stats:

CreatedJul 28, 2018
PublishedJul 29, 2018
Warriors Trained2261
Total Skips243
Total Code Submissions4425
Total Times Completed251
Java Completions48
JavaScript Completions59
Python Completions121
C# Completions24
Haskell Completions12
Factor Completions3
COBOL Completions6
C++ Completions17
Total Stars110
% of votes with a positive feedback rating97% of 67
Total "Very Satisfied" Votes63
Total "Somewhat Satisfied" Votes4
Total "Not Satisfied" Votes0
Total Rank Assessments7
Average Assessed Rank
5 kyu
Highest Assessed Rank
4 kyu
Lowest Assessed Rank
6 kyu
Ad
Contributors
  • hobovsky Avatar
  • kazk Avatar
  • JohanWiltink Avatar
  • user6793616 Avatar
  • Kacarott Avatar
  • dfhwze Avatar
Ad