HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Array and Matrices > problem:


50669 - Area of an Irregular Polygon

Guest
• Review clarifications (1)

Volume problems

• 50870 - ZScore normalization
• 50869 - Birthday Celebration
• 50821 - Derivative of an array
• 50513 - Climbing Up the Stairs
• 50854 - Area of Triangle Revised
• 50520 - Filling a Matrix Randomly
• 50497 - Falling Bricks - Revisited
• 50847 - The first m trains to leave
• 50669 - Area of an Irregular Po...
• 50860 - Number of Student Certificates
• 50444 - n digit kth number divisible...
• 50865 - Apartment Building Adminis...
• 51011 - Decoding the Path
• 51019 - Finding the hidden message
• 51002 - The most successful classes
• 50525 - Ordering Pizza
• 50342 - 100 Factorial

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

Area of an Irregular Polygon

When calculating the area of an irregular polygon, all the vertices are written down in order ending with the starting vertex. Then the product of first y with the second x is subtracted from the product of first x is with the second y, etc.

Question:
Write a program that calculates the area of the given polygon.

Input specification
You are given first an integer number n 0 ≤ n ≤ 10,000. Then, in the following n lines you are given coordinates of an irregular polygon. Each coordinate x and y can have any value between -20,000 and +20,000.

Output specification
Show one number with one digit double precision: Area of the given polygon.

 Sample Input   
 5
 -3 -2
 -1 4
 6 1
 3 10
 -4 9
 Sample Output   
 60


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

www.contester.ru