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рочно
// Внимание! Если программа не работает, обновите версию!
begin
var (n,m):=ReadInteger2('Количество строк и столбцов в матрице:');
Writeln('*** Исходная матрица ***');
var a:=MatrRandom(n,m,-10,99);
a.Println(4); Writeln(4*a.ColCount*'-');
var L:=new List<integer>; // для номеров подходящих строк
for var i:=0 to n-1 do
if a.Row(i).Any(t->t<=0) then L.Add(i);
n:=L.Count;
if n=0 then begin
Writeln('Все строки содержат только положительные элементы');
exit
end;
var b:=new integer[n,m];
for var i:=0 to n-1 do
b.SetRow(i,a.Row(L[i]));
Writeln('*** Результирующая матрица ***');
b.Println(4)
end.
Пример
Количество строк и столбцов в матрице: 5 4
*** Исходная матрица ***
12 -9 64 34
53 64 49 74
33 27 -6 72
91 14 23 16
15 64 9 77
----------------
*** Результирующая матрица ***
12 -9 64 34
33 27 -6 72
Var
День,Месяц:byte;
Begin
Write('№ дня = ');ReadLn(День);
Var C:=365-День;
Write('№ месяца = ');ReadLn(Месяц);
Case Месяц of
2:C:=C-31;
3:C:=C-59;
4:C:=C-90;
5:C:=C-120;
6:C:=C-151;
7:C:=C-181;
8:C:=C-212;
9:C:=C-243;
10:C:=C-273;
11:C:=C-304;
12:C:=C-334
End;
if (C mod 100>10)and(C mod 100<20) then Write('До нового года осталось ',C,' дней')
else
Case C mod 10 of
1:Write('До нового года остался ',C,' день');
2..4:Write('До нового года осталось ',C,' дня');
0,5..9:Write('До нового года осталось ',C,' дней')
End
End
Объяснение: