Problem:
Area For a given polygon g , computes the area of the polygon.  g is represented by a sequence of points p 1 , p 2 ,..., p n where line segments connecting p i and p i+1 (1 ≤ i ≤ n-1 ) are sides of g . The line segment connecting p n and p 1 is also a side of the polygon. Note that the polygon is not necessarily convex. Input The input consists of coordinates of the points p 1 ,..., p n in the following format:  n  x 1  y 1  x 2  y 2 : x n  y n  The first integer n is the number of points. The coordinate of a point p i is given by two integers x i and y i . The coordinates of points are given in the order of counter-clockwise visit of them. Output Print the area of the polygon in a line. The area should be printed with one digit to the right of the decimal point. Constraints  3 ≤ n ≤ 100  -10000 ≤ x i , y i ≤ 10000  No point will occur more than once.  Two sides can intersect only at a common endpoint.  Sample Input 1 3
0 0
2 2
-1 1 Sample Output 1 2.0 Sample Input 2 4
0 0
1 1
1 2
0 2 Sample Output 2 1.5

Solution (Python):
from sys import stdin
readline = stdin.readline


def dot(a, b):
    return a.real * b.real + a.imag * b.imag


def cross(a, b):
    return a.real * b.imag - a.imag * b.real


def triangle(a, b, c):
    v1, v2 = b - a, c - a
    s = abs(v1) ** 2 * abs(v2) ** 2 - dot(v1, v2) ** 2
    return s ** 0.5 * 0.5


def polygon(p):
    return 0.5 * sum(cross(p[i - 1], p[i]) for i in range(len(p)))


n = int(readline())
p = [map(int, readline().split()) for _ in range(n)]
p = [x + y * 1j for x, y in p]
print('{:.1f}'.format(polygon(p)))

Solution (Python):
n = int(input())
points = [tuple(map(int, input().split())) for _ in range(n)]
result = 0
px, py = points[0]
while points:
    x, y = points.pop()
    result += x * py - px * y
    px, py = x, y
print(abs(result) / 2)

Solution (Python):
n = int(input())
points = [complex(*map(int, input().split())) for _ in range(n)]
result, prev = 0, points[0]
while points:
    point = points.pop()
    result += point.real * prev.imag - prev.real * point.imag
    prev = point
print(abs(result) / 2)

Solution (Python):
n = input()
p = [map(int, raw_input().split()) for i in xrange(n)]
print abs(sum(p[i][0]*p[i-1][1] - p[i][1]*p[i-1][0] for i in xrange(n))) / 2.

Solution (Python):


import cmath


def outer_product(v1, v2):
    return v1.real * v2.imag - v1.imag * v2.real


def area_polygon(n, points):
    s = sum(outer_product(points[i], points[(i + 1) % n])
            for i in range(n)) / 2.0
    return s


def main():
    n = int(input())
    ps = [complex(*map(float, input().split())) for _ in range(n)]
    s = area_polygon(n, ps)
    print("{:.1f}".format(s))


if __name__ == '__main__':
    main()

Solution (Python):
n = int(raw_input())
S = float(0)
x = []
y = []
for _ in range(n):
  xi,yi = map(float, raw_input().split())
  x.append(xi)
  y.append(yi)
for i in range(n):
  S += x[i] * y[(i+1) % n] - x[(i+1) % n] * y[i]
S = S / 2
print "%.1f" % S

Solution (Python):
p=[complex(*map(int,input().split())) for _ in range(int(input()))]
s,pre=0,p[0]
while p:
    now=p.pop()
    s+=now.real*pre.imag-now.imag*pre.real
    pre=now
print(abs(s)/2)

Solution (Python):
def area(p,q):
    return (p[0]*q[1]-p[1]*q[0])*0.5

n=int(input())
point=[]
x_1,y_1=[int(i) for i in input().split(" ")]

for i in range(n-1):
    x,y=[int(k) for k in input().split(" ")]
    point.append([x-x_1,y-y_1])



a=0


for i in range(n-2):
    a+=area(point[i],point[i+1])

print(a)

Solution (Python):
def cross(a,b):return a[0]*b[1] - a[1]*b[0]
        
n = int(input())
P =[]
s = 0
for i in range(n):P.append([int(i) for i in input().split()])
P = P*2
for i in range(n):s += cross(P[i],P[i+1])
print(abs(s)/2)

Solution (Python):
def cross(a,b):return a[0]*b[1] - a[1]*b[0]
        
n = int(input())
P =[]
s = 0
for i in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for i in range(n):s += cross(P[i],P[i+1])
print(abs(s)*0.5)

Solution (Python):
n = int(input())
P =[]
s = 0
for i in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for i in range(n):s += P[i][0]*P[i+1][1] - P[i][1]*P[i+1][0]
print(abs(s)*0.5)

Solution (Python):
n = int(input())
P =[]
s = 0
for i in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for i in range(n):
    j = i+1
    s += P[i][0]*P[j][1] - P[i][1]*P[j][0]
print(abs(s)*0.5)

Solution (Python):
n = int(input())
P =[]
s = 0
for i in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for i in range(n):
    a = P[i][0] ; b = P[i][1]; c = P[i+1][0] ; d = P[i+1][1]
    s += a * d - b * c
print(abs(s)*0.5)

Solution (Python):
n = int(input())
P =[]
s = 0
x0,y0 = [int(i) for i in input().split()]
for i in range(n-1):
    x,y = [int(i) for i in input().split()]
    P.append([x-x0,y-y0])
for i in range(n-2):
    s += P[i][0]*P[i+1][1] - P[i][1]*P[i+1][0]
print(abs(s)*0.5)

Solution (Python):
n = int(input())
P =[]
s = 0
for i in range(n):P.append(input().split())
P.append(P[0])
for i in range(n):s += int(P[i][0])*int(P[i+1][1]) - int(P[i][1])*int(P[i+1][0])
print(abs(s)*0.5)

Solution (Python):
n = int(input())
P =[]
s = 0
for i in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for i in range(n):s += (P[i][0]*P[i+1][1] - P[i][1]*P[i+1][0])
print(abs(s)*0.5)

Solution (Python):
n = int(input())
P =[]
s = 0
for i in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for i in range(n):s += (P[i][0])*P[i+1][1] - (P[i][1])*P[i+1][0]
print(abs(s)*0.5)

Solution (Python):
n = int(input())
P =[]
s = 0
for i in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for i in range(n):s += P[i][0]*P[i+1][1] - P[i][1]*P[i+1][0]
print(s*0.5)

Solution (Python):
n = int(input())
P =[]
s = 0
for i in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for j in range(n):s += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
print(s*0.5)

Solution (Python):
n = int(input())
P =[]
s = 0
for _ in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for j in range(n):s += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
print(s*0.5)

Solution (Python):
n = int(input())
P =[]
s = 0
for _ in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for j in range(n):s += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
print(s*0.5)

Solution (Python):
def area(p,q):return p[0]*q[1]-p[1]*q[0]
 
n=int(input())
point=[]
x_1,y_1=[int(i) for i in input().split(" ")]
 
for i in range(n-1):
    x,y=[int(k) for k in input().split(" ")]
    point.append([x-x_1,y-y_1])
a=0
for i in range(n-2):a+=area(point[i],point[i+1])
print(a*0.5)

Solution (Python):
def area(p,q):return p[0]*q[1]-p[1]*q[0]
 
n=int(input())
point=[]
x_1,y_1=[int(i) for i in input().split(" ")]
 
for i in range(n-1):
    x,y=[int(k) for k in input().split(" ")]
    point.append([x-x_1,y-y_1])
a=0
for i in range(n-2):a+=area(point[i],point[i+1])
print(a*0.5)

Solution (Python):
def area(p,q):return p[0]*q[1]-p[1]*q[0]
 
n=int(input())
point=[]
x_1,y_1=[int(i) for i in input().split(" ")]
 
for _ in range(n-1):
    x,y=[int(k) for k in input().split(" ")]
    point.append([x-x_1,y-y_1])
a=0
for j in range(n-2):a+=area(point[j],point[j+1])
print(a*0.5)

Solution (Python):
def area(p,q):return p[0]*q[1]-p[1]*q[0]
 
n=int(input())
point=[]
x_1,y_1=[int(i) for i in input().split(" ")]
 
for _ in range(n-1):
    x,y=[int(k) for k in input().split(" ")]
    point.append([x-x_1,y-y_1])
a=0
for j in range(n-2):a+=area(point[j],point[j+1])
print(a*0.5)

Solution (Python):
def area(p,q):return p[0]*q[1]-p[1]*q[0]
 
n=int(input())
point=[]
x_1,y_1=[int(i) for i in input().split(" ")]
 
for _ in range(n-1):
    x,y=[int(i) for i in input().split(" ")]
    point.append([x-x_1,y-y_1])
a=0
for i in range(n-2):a+=area(point[i],point[i+1])
print(a*0.5)

Solution (Python):
n=int(input())
point=[]
x_1,y_1=[int(i) for i in input().split(" ")]
 
for _ in range(n-1):
    x,y=[int(i) for i in input().split(" ")]
    point.append([x-x_1,y-y_1])
a=0
for i in range(n-2):a+=point[i][0]*point[i+1][1] - point[i][1]*point[i+1][0]
print(a*0.5)

Solution (Python):
def area(p,q):return p[0]*q[1]-p[1]*q[0]
n = int(input())
P =[]
s = 0
for _ in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for i in range(n):s += P[i][0]*P[i+1][1] - P[i][1]*P[i+1][0]
print(s*0.5)

Solution (Python):
def area(p,q):return p[0]*q[1]-p[1]*q[0]
n = int(input())
P =[]
s = 0
for _ in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for i in range(n):s += P[i][0]*P[i+1][1] - P[i][1]*P[i+1][0]
print(s*0.5)

Solution (Python):
def area(p,q):return p[0]*q[1]-p[1]*q[0]
n = int(input())
P =[]
s = 0
for _ in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for i in range(n):s += P[i][0]*P[i+1][1] - P[i][1]*P[i+1][0]
print(s*0.5)

Solution (Python):
n = int(input())
P =[]
s = 0
for i in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for j in range(n):s += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
print(s*0.5)

Solution (Python):
n = int(input())
P =[]
s = 0
for _ in range(n):P.append(list(map(int,input().split())))
P.append(P[0])
for j in range(n):s += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
print(s*0.5)

Solution (Python):
n = int(input())
P =[]
s = 0
for _ in range(n):P.append(list(map(int,input().split())))
P.append(P[0])
for j in range(n):s += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
print(s*0.5)

Solution (Python):
n = int(input())
P =[]
s = 0
for _ in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for j in range(n):s += - P[j][1]*P[j+1][0] + P[j+1][1] * P[j][0]
print(s*0.5)

Solution (Python):
n = int(input())
P =[]
s = 0
for _ in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for j in range(n):s += - P[j][1]*P[j+1][0] + P[j+1][1] * P[j][0]
print(s*0.5)

Solution (Python):
n = int(input())
P =[]
s = 0
for _ in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for j in range(n):s += P[j][1]*P[j+1][0] - P[j+1][1] * P[j][0]
print(s*-0.5)

Solution (Python):
n = int(input())
P =[]
s = 0
for _ in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for j in range(n):s += P[j][1]*P[j+1][0] -  P[j][0] * P[j+1][1]
print(s*-0.5)

Solution (Python):
n = int(input())
P =[]
s = 0
for _ in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for j in range(n):s -= P[j][1]*P[j+1][0] -  P[j][0] * P[j+1][1]
print(s*0.5)

Solution (Python):
n = int(input())
P =[]
s = 0
for _ in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for j in range(n):s += P[j][1]*P[j+1][0] -  P[j][0] * P[j+1][1]
print(-s*0.5)

Solution (Python):
n = int(input())
x = range(n)
P =[]
s = 0
for _ in x:P.append([int(i) for i in input().split()])
P.append(P[0])
for j in x:s += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
print(s*0.5)

Solution (Python):
n = int(input())
x = range(n)
P =[]
s = 0
for _ in x:P.append([int(i) for i in input().split()])
P.append(P[0])
for j in x:s += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
print(s*0.5)

Solution (Python):
n = int(input())
x = range(n)
P =[]
s = 0
for _ in x:P.append([int(i) for i in input().split()])
P.append(P[0])
for j in x:s += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
print(s*0.5)

Solution (Python):
n = int(input())
x = range(n)
P =[]
s = 0
for _ in x:P.append([int(i) for i in input().split()])
P+=[P[0]]
for j in x:s += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
print(s*0.5)

Solution (Python):
n = int(input())
x = range(n)
P =[]
s = 0
for _ in x:P += [[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:s += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
print(s*0.5)

Solution (Python):
n = int(input())
x = range(n)
P =[]
s = 0
for _ in x:P += [[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:s += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
print(s*0.5)

Solution (Python):
n = int(input())
x = range(n)
P =[]
s = 0
for _ in x:P += [[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:s += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
print(s*0.5)

Solution (Python):
n = int(input())
P =[]
s = 0
for _ in range(n):P += [[int(i) for i in input().split()]]
for j in range(n-1):s += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
s += P[-1][0]*P[0][1] - P[-1][1]*P[0][0]
print(s*0.5)

Solution (Python):
n = int(input())
P =[]
s = 0
for _ in range(n):P += [[int(i) for i in input().split()]]
for j in range(n-1):s += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
s += P[-1][0]*P[0][1] - P[-1][1]*P[0][0]
print(s*0.5)

Solution (Python):
n = int(input())
x = range(n)
P =[]
s = 0
for i in x:P += [[int(i) for i in input().split()]]
P+=[P[0]]
for i in x:s += P[i][0]*P[i+1][1] - P[i][1]*P[i+1][0]
print(s*0.5)

Solution (Python):
n = int(input())
x = range(n)
P =[]
s = 0
for i in x:P += [[int(i) for i in input().split()]]
P+=[P[0]]
for i in x:s += P[i][0]*P[i+1][1] - P[i][1]*P[i+1][0]
print(s*0.5)

Solution (Python):
n = int(input())
x = range(n)
P =[]
s = 0
for i in x:P += [[int(i) for i in input().split()]]
P+=[P[0]]
for i in x:s += P[i][0]*P[i+1][1] - P[i][1]*P[i+1][0]
print(s*0.5)

Solution (Python):
x = range(int(input()))
P =[]
s = 0
for i in x:P += [[int(i) for i in input().split()]]
P+=[P[0]]
for i in x:s += P[i][0]*P[i+1][1] - P[i][1]*P[i+1][0]
print(s*0.5)

Solution (Python):
x = range(int(input()))
P =[]
s = 0
for i in x:P += [[int(i) for i in input().split()]]
P+=[P[0]]
for i in x:s += P[i][0]*P[i+1][1] - P[i][1]*P[i+1][0]
print(s*0.5)

Solution (Python):
x = range(int(input()))
P =[]
s = 0
for i in x:P += [[int(i) for i in input().split()]]
P+=[P[0]]
for i in x:s += P[i][0]*P[i+1][1] - P[i][1]*P[i+1][0]
print(s*0.5)

Solution (Python):
x=range(int(input()))
P=[]
s=0
for i in x:P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for i in x:s+=P[i][0]*P[i+1][1]-P[i][1]*P[i+1][0]
print(s*0.5)

Solution (Python):
x=range(int(input()))
P=[]
s=0
for i in x:P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for i in x:s+=P[i][0]*P[i+1][1]-P[i][1]*P[i+1][0]
print(s*0.5)

Solution (Python):
n = int(input())
x = range(n)
P =[]
n = 0
for _ in x:P += [[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:n += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
print(n*0.5)

Solution (Python):
n = int(input())
x = range(n)
P =[]
n = 0
for _ in x:P += [[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:n += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
print(n*0.5)

Solution (Python):
n = int(input())
x = range(n)
P =[]
n = 0
for _ in x:P += [[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:n += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
print(n*0.5)

Solution (Python):
x=range(int(input()))
P=[]
s=0
for _ in x:P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:s+=P[j][0]*P[j+1][1]-P[j][1]*P[j+1][0]
print(s*0.5)

Solution (Python):
x=range(int(input()))
P=[]
s=0
for _ in x:P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:s+=P[j][0]*P[j+1][1]-P[j][1]*P[j+1][0]
print(s*0.5)

Solution (Python):
x=range(int(input()))
P=[]
s=0
for _ in x:P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:s+=P[j][0]*P[j+1][1]-P[j][1]*P[j+1][0]
print(s*0.5)

Solution (Python):
x=range(int(input()))
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:_+=P[j][0]*P[j+1][1]-P[j][1]*P[j+1][0]
print(_*0.5)

Solution (Python):
x=range(int(input()))
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:_+=P[j][0]*P[j+1][1]-P[j][1]*P[j+1][0]
print(_*0.5)

Solution (Python):
x=range(int(input())-1,-1,-1)
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:_+=P[j][0]*P[j+1][1]-P[j][1]*P[j+1][0]
print(_*0.5)

Solution (Python):
x=range(int(input())-1,-1,-1)
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:_+=P[j][0]*P[j+1][1]-P[j][1]*P[j+1][0]
print(_*0.5)

Solution (Python):
x=range(int(input()),0,-1)
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:_+=P[j-1][0]*P[j][1]-P[j-1][1]*P[j][0]
print(_*0.5-0.5)

Solution (Python):
x=range(int(input()),0,-1)
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:_+=P[j-1][0]*P[j][1]-P[j-1][1]*P[j][0]
print(_*0.5-0.5)

Solution (Python):
x=range(int(input()),0,-1)
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:_+=P[j-1][0]*P[j][1]-P[j-1][1]*P[j][0]
print(_*0.5-0.5)

Solution (Python):
x=range(int(input()))
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:
    k = j+1
    _+=P[j][0]*P[k][1]-P[j][1]*P[k][0]
print(_*0.5)

Solution (Python):
x=range(int(input()))
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:
    k = j+1
    _+=P[j][0]*P[k][1]-P[j][1]*P[k][0]
print(_*0.5)

Solution (Python):
x=range(int(input()))
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:
    k = j+1
    _+=P[j][0]*P[k][1]-P[j][1]*P[k][0]
print(_*0.5)

Solution (Python):
x=range(int(input()))
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:
    i = j+1
    _+=P[j][0]*P[i][1]-P[j][1]*P[i][0]
print(_*0.5)

Solution (Python):
x=range(int(input()))
f=lambda a,d,b,c : a*d - b*c 
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:_+=f(P[j][0],P[j+1][1],P[j][1],P[j+1][0])
print(_*0.5)

Solution (Python):
x=range(int(input()))
f=lambda a,d,b,c : a*d - b*c 
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:_+=f(P[j][0],P[j+1][1],P[j][1],P[j+1][0])
print(_*0.5)

Solution (Python):
x=range(int(input()))
f=lambda a,d,b,c : a*d - b*c 
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:_+=f(P[j][0],P[j+1][1],P[j][1],P[j+1][0])
print(_*0.5)

Solution (Python):
x=range(int(input()))
f=lambda a,b,c,d : a*d - b*c 
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:_+=f(P[j][0],P[j][1],P[j+1][0],P[j+1][1])
print(_*0.5)

Solution (Python):
x=range(int(input()))
f=lambda a,b,c,d : a*d - b*c 
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:_+=f(P[j][0],P[j][1],P[j+1][0],P[j+1][1])
print(_*0.5)

Solution (Python):
x=range(int(input()))
f=lambda a,b,c,d : a*d - b*c 
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:_+=f(P[j][0],P[j][1],P[j+1][0],P[j+1][1])
print(_*0.5)

Solution (Python):
x=range(int(input()))
f=lambda a,b,c,d : a*d - b*c 
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:_+=f(P[j][0],P[j][1],P[j+1][0],P[j+1][1])
print(_*0.5)

Solution (Python):
x=range(int(input()))
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:_+=P[j][0]*P[j+1][1]-P[j][1]*P[j+1][0]
print(_*0.5)

Solution (Python):
x=range(int(input()))
P=[]
Q=[]
for _ in x:P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:Q+=[P[j][0]*P[j+1][1]-P[j][1]*P[j+1][0]]
print(sum(Q)*0.5)

Solution (Python):
x=range(int(input()))
P=[]
Q=[]
for _ in x:P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:Q+=[P[j][0]*P[j+1][1]-P[j][1]*P[j+1][0]]
print(sum(Q)*0.5)

Solution (Python):
x=range(int(input()))
P=[]
Q=[]
for _ in x:P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:Q+=[P[j][0]*P[j+1][1]-P[j][1]*P[j+1][0]]
print(sum(Q)*0.5)

Solution (Python):
x=range(int(input()))
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:_+=P[j][0]*P[j+1][1]-P[j+1][0]*P[j][1]
print(_*0.5)

Solution (Python):
x=range(int(input()))
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:_+=P[j][0]*P[j+1][1]-P[j+1][0]*P[j][1]
print(_*0.5)

Solution (Python):
x=range(int(input()))
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:_+=P[j+1][1]*P[j][0]-P[j][1]*P[j+1][0]
print(_*0.5)

Solution (Python):
x=range(int(input()))
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:_+=P[j+1][1]*P[j][0]-P[j][1]*P[j+1][0]
print(_*0.5)

Solution (Python):
x=range(int(input()))
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:_+=P[j+1][1]*P[j][0]-P[j][1]*P[j+1][0]
print(_*0.5)

Solution (Python):
x=range(int(input()))
P=[]
for _ in reversed(x):P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:_+=P[j+1][1]*P[j][0]-P[j][1]*P[j+1][0]
print(_*0.5)

Solution (Python):
x=range(int(input()))
P=[]
for _ in reversed(x):P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:_+=P[j+1][1]*P[j][0]-P[j][1]*P[j+1][0]
print(_*0.5)

Solution (Python):
x=range(int(input())-1,-1,-1)
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:_+=P[j+1][1]*P[j][0]-P[j][1]*P[j+1][0]
print(_*0.5)

Solution (Python):
x=range(int(input())-1,-1,-1)
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:_+=P[j+1][1]*P[j][0]-P[j][1]*P[j+1][0]
print(_*0.5)

Solution (Python):
x=range(int(input())-1,-1,-1)
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:_+=P[j+1][1]*P[j][0]-P[j][1]*P[j+1][0]
print(_*0.5)

Solution (Python):
x=range(int(input())-1,-1,-1)
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:_+=P[j+1][1]*P[j][0]-P[j][1]*P[j+1][0]
print(_*0.5)

Solution (Python):


import sys, math, os


PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


def poly_area(polygon, M):
    A = 0
    for i in range(M):
        x1, y1 = polygon[i][0], polygon[i][1]
        x2, y2 = polygon[(i+1)%M][0], polygon[(i+1)%M][1]
        A += (x1 * y2 - x2 * y1)
    return abs(A / 2)

N = int(input())
P = [[int(_) for _ in input().split()] for __ in range(N)]
print(poly_area(P, N))

Solution (Python):


n=int(input())

xy=[]
answer=0

for i in range(n):
    xy.append(list(map(float,input().split())))

for i in range(0,n):
    answer+=(xy[i][0]-xy[i-1][0])*(xy[i][1]+xy[i-1][1])

print(abs(answer)/2)

Solution (Python):
import math

class Vector():
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def inner_product(self, vec):
        return self.x*vec.x + self.y*vec.y

    def outer_product(self, vec):
        return self.x*vec.y - self.y*vec.x

    def norm(self):
        return math.sqrt(self.x**2 + self.y**2)

n = int(input())
points = []
for i in range(n):
    x, y = list(map(int, input().split(' ')))
    points.append(Vector(x, y))
points.append(points[0])

area = 0
for i in range(n):
    a, b = points[i], points[i+1]
    if (a.x == 0 and a.y == 0) or (b.x == 0 and b.y == 0): continue
    theta = math.atan2(a.outer_product(b), a.inner_product(b))
    if theta > 0:
        area += abs(a.outer_product(b))/2
    elif theta < 0:
        area -= abs(a.outer_product(b))/2
print(area)

Solution (Python):
def area(p,q,r):
    a = (q[0]-p[0], q[1]-p[1])
    b = (r[0]-p[0], r[1]-p[1])
    return (a[0]*b[1] - b[0]*a[1]) / 2

n = int(input())

v = []
for _ in range(n):
    v.append([float(x) for x in input().split()])

v = list(reversed(v))

s = 0

for i in range(1,n-1):
    s += area(v[0],v[i],v[i+1])

print(-1 * round(s,1))

Solution (Python):
p= []
n= int(input())

for i in range(n):
    x,y = map(float,input().split())
    p.append(complex(x,y))


n=len(p)
sum=0.0
for i in range(1,n-1):
    a,b= p[i]-p[0], p[i+1]-p[0]
    s= (a.conjugate()* b).imag
    sum+= s
print("%.1f" % (abs(sum)/2.0))

Solution (Python):
n = int(input())
a = []
for _ in range(n):
    x, y = map(int, input().split())
    a.append(complex(x, y))
ans = 0.0
p = a[0]
for i in range(n - 2):
    q, r = a[i + 1], a[i + 2]
    ans += (((q - p).conjugate() * (r - p)).imag) / 2
print(abs(ans))

Solution (Python):
def cross_product(a,b):
  return (a.conjugate()*b).imag
P = [] 
n = int(input())
for i in range(n):
    x,y = map(float,input().split())
    P.append(complex(x,y))
N=len(P)
total = 0.0
for i in range(1,N-1):
    a,b,c = P[0],P[i],P[i+1]
    total += cross_product(b-a,c-a)
print('{:.1f}'.format(abs(total)/2.0))

Solution (Python):
import math
import cmath
def dot(a:complex,b:complex):
  return (a.conjugate()*b).real
def cross(a:complex,b:complex):
  return (a.conjugate()*b).imag
p=[]
n=int(input())
for i in range(n):
  x,y=map(float,input().split())
  p.append(complex(x,y))
S=0
for i in range(1,len(p)-1):
  S+=cross(p[i]-p[0],p[i+1]-p[0])
print(abs(S)/2)

Solution (Python):
def get_area(ps):
    """頂点集合psから成る多角形の面積を求める。"""
    n = len(ps)
    ans = 0
    for i in range(n):
        p1 = ps[i]
        p2 = ps[i - 1]
        ans += (p1[0] * p2[1] - p2[0] * p1[1]) / 2
    return abs(ans)


n = int(input())
ps = [list(map(int, input().split())) for i in range(n)]

print(get_area(ps))