package main import . "fmt" import . "math/cmplx" import m "math" func main() { var n int Scan(&n) a:=make([]complex128, n) for i := range a{ var x,y float64 Scan(&x,&y) a[i] = Rect(x,0)+Rect(y,0)*1i } a=append(a,a[0]) var ans float64 for i,v := range a[1:] { ans += real(a[i])*imag(v)-imag(a[i])*real(v) } Println(m.Abs(ans)) }