package main import . "fmt" import . "math/cmplx" 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]*v) } Println(int64(ans)) }