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

Разделы > Геометрия > задача:


50825 - Drawing Polygon

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

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

• 50268 - Triangles
• 51041 - Plane Segmentation
• 50670 - Picture
• 50487 - Radius of Inscribed Circle
• 50480 - What quadrant is it?
• 50473 - Counting Circles Positions
• 50327 - Parallel Lines
• 50328 - How far away
• 50825 - Drawing Polygon
• 50508 - The Biggest Area
• 51034 - Area of 3 Shapes
• 50854 - Area of Triangle Revised
• 50669 - Area of an Irregular Polygon
• 50560 - Distanca maksimale
• 50237 - Is it the same color?
• 50422 - Area and Perimeter of diffe...
• 50399 - Mobile Base Station

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

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

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

Drawing Polygon

Assume that you are asked to draw an equilateral n-gon. And you start always from (0,0) and you first draw a horizontal line to the right.

Question: Given the length and the number of sides of an equilateral n-gon. Find the distance between two vertices a, b.
Note: Use integer values for vertex coordinates.

Input specification
You will be given 4 numbers

  • The length of one side (length)
  • the number of vertices of n-gon (n)
  • two integers: two vertex numbers to calculate the distance
where 0 ≤ length ≤ 2000, where 3 ≤ n ≤ 90, and 1 ≤ (a,b) ≤ n.

Output specification:
Show the distance with two digits precision.

Sample Input I
10 4 2 4
Sample Input II
50 5 2 4
Sample Output I
14.14
Sample Output II
80.96

Explanation: It is equilateral 4-gon (square) with 10 cm on each side. The distance between vertex2 and vertex4 is asked.

  1. The starting vertex is said to be (0, 0)
  2. And, the second vertex is (10, 0)
  3. The third vertex is (10, 10)
  4. The fourth vertex is (0, 10)
Then the distance between the second and the fourth vertices is 10 √2 = 14.14.



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

www.contester.ru