kalina19762005
04.03.2022 11:36

Mech's spaceship landed on an alien planet. The brave explorer decided to have a walk around. The scenery was very picturesque - huge rocks under the black sky with several moons... Soon he approached an edge of a terrifying hole. He looked down and suddenly saw there one of the planet's moons - the hole went down through the whole planet!! "Abyss..." - Mech whispered in primal awe. He was so impressed that decided to estimate how large the abyss is in comparison with the planet. To start with he wants to calculate the actual volume of the planet i.e. its volume without the space in the abyss. Assume that the planet is a perfect ball and the abyss has the form of a cylinder that is symmetrically cut out of the ball as shown below. The only information Mech managed to get is the depth of the abyss. He now wonders if it is possible to calculate the volume of the ball with the cut out cylinder of the given depth. Help him and write a program to calculate it without knowing the radius of the planet. Don't be surprised - it is really possible!

Hint: consider the previous sentence as a hint :))

Input

Input will contain only one real number 0<=depth<=100 - the depth of the abyss in megameters.

Output

Your program should produce only one line with the actual volume of the planet in cubic megameters rounded to three digits after decimal point.

Sample input

0.31

Sample output
0.016

cрочно

Нажмите на рекламу ниже и сразу увидите ответ
↓
Популярные вопросы:
Ответ:
Vladosik0987
14.12.2022 10:01
Выполняя алгоритм, получаем следующий результат (15 итераций)

1. 0..65534 -> 32767
2. 0..32766 -> 16383
3. 0..16382 -> 8191
4. 0..8190  -> 4095
5. 0..4094  -> 2047
6. 2048..4094 -> 3071
7. 2048..3070 -> 2559
8. 2560..3070 -> 2815
9. 2816..3070 -> 2943
10. 2944..3070 -> 3007
11. 2944..3006 -> 2975
12. 2976..3006 -> 2991
13. 2992..3006 -> 2999
14. 3000..3006 -> 3003
15. 3000..3002 -> 3001

Если лень перебирать вручную, можно воспользоваться программой

var k,l,r,x,f:integer;
begin
f := 3001;
l := 0;
r := 65534;
x := (l + r) div 2;
k := 1;
while (x <> f) and (l < r) do
  begin
  writeln(k,' ',l,' ',r,' ',x);
  k := k + 1;
  if f < x then r := x - 1
    else l := x + 1;
  x := (l + r) div 2
  end;
writeln(k,' ',l,' ',r,' ',x);
end.
0,0(0 оценок)
Ответ:
Gbr330
26.11.2020 18:01
По выполняемым функциям и возможности применения информационные технологии делят на используемые:1) в автономных компьютерах (ПЭВМ) и в локальных рабочих станциях (АРМ) в составе сетевых автоматизированных информационных систем (АИС) реального времени;2) в объектно-ориентированных, распределённых, корпоративных и иных локальных и сетевых информационно-поисковых, гипертекстовых и мультимедийных системах;3) в системах с искусственным интеллектом;4) в интегрированных АИС;5) в геоинформационных, глобальных и других системах.
0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота