Помощничек
Главная | Обратная связь


Археология
Архитектура
Астрономия
Аудит
Биология
Ботаника
Бухгалтерский учёт
Войное дело
Генетика
География
Геология
Дизайн
Искусство
История
Кино
Кулинария
Культура
Литература
Математика
Медицина
Металлургия
Мифология
Музыка
Психология
Религия
Спорт
Строительство
Техника
Транспорт
Туризм
Усадьба
Физика
Фотография
Химия
Экология
Электричество
Электроника
Энергетика

Sample input and output



aerodynamics.in aerodynamics.out
9 0 5 0 0 5 -3 0 2 0 -1 2 3 0 2 0 1 2 2 2 0 2 -2 0 -2 -2 0 -2 2 0 16.00000 14.92000 10.08000 4.48000 1.12000 0.00000

Задача 9. Asteroids

Input file: asteroids.in

Output file: asteroids.out

Time Limit: 1 second

Memory Limit: 64M byte

 

Association of Collision Management (ACM) is planning to perform the controlled collision of two asteroids. The asteroids will be slowly brought together and collided at negligible speed. ACM expects asteroids to get attached to each other and form a stable object. Each asteroid has the form of a convex polyhedron. To increase the chances of success of the experiment ACM wants to bring asteroids together in such manner that their centers of mass are as close as possible. To achieve this, ACM operators can rotate the asteroids and move them independently before bringing them together. Help ACM to ¯nd out what minimal distance between centers of mass can be achieved. For the purpose of calculating center of mass both asteroids are considered to have constant density.

 

Input

Input file contains two descriptions of convex polyhedra. The first line of each description contains integer number n - the number of vertices of the polyhedron (4 ≤ n ≤ 60). The following n lines contain three integer numbers xi, yi, zi each - the coordinates of the polyhedron vertices (-104 ≤ xi, yi, zi104). It is guaranteed that the given points are vertices of a convex polyhedron, in particular no point belongs to the convex hull of other points. Each polyhedron is non-degenerate. The two given polyhedra have no common points.

 

Output

Output one floating point number - the minimal distance between centers of mass of the asteroids that can be achieved. Your answer must be accurate up to 10-5.

 

Sample input and output

asteroids.in asteroids.out
0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 5 1 0 6 -1 0 6 0 1 6 0 -1 6 0.75

Задача 10. Damage Assessment

Input file: damage.in

Output file: damage.out

Time Limit: 1 second

Memory Limit: 64M byte

 

A tank car that transports gasoline via rail road has a shape of cylinder with two spherical caps at the sides. The cylinder has a diameter d and a length l. The spherical caps have a radius r (2rd). There was the rail road accident and the tank car had derailed. It now lies on the ground and some of the stored gasoline had flown out. The damage assessment must be performed. The location of the tank on the ground was established by measuring its tilt as the height difference t from the bottom points of the cylinder on its left and right sides (0 ≤ tl). The level of gasoline in the tank was established by measuring the height difference h from the bottom point of the cylinder and the top level of gasoline. For the purpose of this problem, the top level of gasoline always intersects the cylinder part of the tank (0 ≤ ht + d ). Your task is to figure out how much gasoline was left in the tank.

 

Input

The input file consists of a single line with five integer numbers — d, l, r, t and h, which represent the diameter and the length of the tank’s cylinder part, the radius of its spherical caps, tilt and gasoline level measurements. They are all expressed in millimeters (1 millimeter = 10−3 meters), they satisfy all constraints expressed in the problem statement and d, l ≥ 100, d, l, r ≤ 10 000.

 

Output

Write a single real number to the output file — the volume of gasoline in the tank in liters (1 liter = 10−3 cubic meters). The absolute error of the answer must not exceed 0.1 liters.

 

 




Поиск по сайту:

©2015-2020 studopedya.ru Все права принадлежат авторам размещенных материалов.