ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Разделы > Сортировка и последовательности > задача:


50744 - The Smallest Perimeter

Гость
• Вопросы к жюри (2)

Задачи раздела

• 50915 - Trip to Korca
• 50802 - Comparing Exams
• 50927 - Health Expenses
• 50745 - Bitonic Sequence
• 50992 - Top K Obese Classes
• 50991 - Intersecting Circles
• 50447 - Swimming Contest - 2
• 50513 - Climbing Up the Stairs
• 50744 - The Smallest Perimeter
• 50743 - Total Scholarships Discount
• 50984 - Top m hardworking employees
• 50847 - The first m trains to leave
• 51002 - The most successful classes
• Word Puzzle
• 50740 - Service Time - 1
• 50750 - Service Time - 2
• 50347 - Selling Oranges

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Ibrahim Mesecan.

The Smallest Perimeter

You are given the information about 3 different shapes: Circle, Rectangle, Isosceles triangle.

Question: Find the total perimeter for n shapes and the perimeter of the shape with the smallest perimeter.

Note: Use 3.14159 for PI.

Input specification
You will be given an integer in the beginning: the number of shapes (n) where n is less than 2500. Then in the following n lines, you will be given information for n shapes:

  1. Type of the shape
    1. Circle
    2. Rectangle
    3. Isosceles triangle
  2. If given shape type is
    • 1 (circle), you will be given an integer radius.
    • 2 (rectangle), you will be given two integers a and b.
    • 3 (isosceles triangle), you will be given two integers b and h.

Output specification
Show two information: 1) total perimeter for n shapes (two digits precision) and 2) The perimeter of the shape with the smallest perimeter.

Sample Input I
4
2 12 16
2 20 1
1 3
3 9 1
Sample Output I
135.07 18.22

Explanation:
There are 4 shapes given

  1. Shape 1 is a rectangle and its perimeter is 56.
  2. Shape 2 is also a rectangle with a perimeter of 42.
  3. Shape 3 is a circle with a perimeter of 18.85.
  4. Shape 4 is an isosceles triangle with a perimeter of 18.22. And it's the shape with the smallest perimeter.
So, the total perimeter is 135.07 (56 + 42 + 18.845 + 18.22)


Для отправки решений необходимо выполнить вход.

www.contester.ru