One Line Task: Squirrel And Tree
Description:
Task
Since the weather was good, some students decided to go for a walk in the park after the first lectures of the new academic year. There they saw a squirrel, which climbed a tree in a spiral at a constant angle to the ground. They calculated that in one loop the squirrel climbes h
meters (vertical height), the height of the tree is equal to H
(v
in Ruby), and the length of its circumference equals S
.
These calculations were exhausting, so now the students need your help to figure out how many meters the path length of squirrel climbed when it reached the tree top. The result should be rounded to 4 decimal places.
Code Limit
Less than 52
characters (JavaScript & Python)
Less than 48
characters (Ruby)
Example
For h = 4, H = 16, S = 3
, the output should be 20
.
For h = 8, H = 9, S = 37
, the output should be 42.5869
.
Similar Kata:
Stats:
Created | Apr 27, 2017 |
Published | Apr 27, 2017 |
Warriors Trained | 7102 |
Total Skips | 2405 |
Total Code Submissions | 20297 |
Total Times Completed | 2319 |
JavaScript Completions | 859 |
Ruby Completions | 129 |
Python Completions | 1420 |
Total Stars | 155 |
% of votes with a positive feedback rating | 90% of 453 |
Total "Very Satisfied" Votes | 384 |
Total "Somewhat Satisfied" Votes | 51 |
Total "Not Satisfied" Votes | 18 |
Total Rank Assessments | 4 |
Average Assessed Rank | 4 kyu |
Highest Assessed Rank | 3 kyu |
Lowest Assessed Rank | 5 kyu |