#!/usr/bin/env python3 n = int(input()) pts = [] for i in range(n): pts.append([float(i) for i in input().split()]) #Compute netto area of one of the "sides" #Use recursion A = I + (l1^2)A + (l2^2)A + ... + (l{n-1}^2)A #Determine area I under polyline, i.e. depth 0 I = 0 for i in range(1,n): #compute integral per trapezoid I += 0.5 * (pts[i][1] + pts[i-1][1]) * (pts[i][0] - pts[i-1][0]) #Also compute 1 - l1^2 - ... - l{n-1}^2 f = 1 for i in range(1,n): li2 = (pts[i][0] - pts[i-1][0]) ** 2 + (pts[i][1] - pts[i-1][1]) ** 2 f -= li2 #Note that we can do all the above directly when reading the input, split here for clarity #Add area three times to area initial triangle (i.e. sqrt(3)/4) print((3 ** 0.5 / 4) + 3 * (I / f))