Go: package main

import (
	"bufio"
		"os"
	"strconv"
	"math"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		m, _ := strconv.Atoi(scanner.Text())
		if m == 0 {
			break
		}
		args1 := make([]float64, m)
		x := 0.0
		for i := 0; i < m-1; i++ {
			scanner.Scan()
			tmp, _ := strconv.ParseFloat(scanner.Text(), 64)
			x += tmp
			args1[i] = tmp
		}
		args1[m-1] = 360-x
		first_object := 0.0
		for _, v := range args1 {
			first_object+= math.Sin(v*math.Pi/180)
		}
		scanner.Scan()
		n, _ := strconv.Atoi(scanner.Text())
		args2 := make([]float64, n)
		y := 0.0
		for i := 0; i < n-1; i++ {
			scanner.Scan()
			tmp, _ := strconv.ParseFloat(scanner.Text(), 64)
			y += tmp
			args2[i] = tmp
		}
		args2[n-1] = 360-y
		second_object := 0.0
		for _, v := range args2 {
			second_object+= math.Sin(v*math.Pi/180)
		}
		if first_object > second_object+ 0.0000001 {
			fmt.Println(1)
		} else if second_object > first_object +0.0000001 {
			fmt.Println(2)
		} else {
			fmt.Println(0)
		}
	}
}

Python: import math

ONE_BIGGER_TWO = 1
TWO_BIGGER_ONE = 2
SAME = 0


def calculate_area(input_list):
    last = 360 - sum(input_list)
    input_list.append(last)

    radian_list = [math.radians(item) for item in input_list]
    sin_list = [math.sin(item) for item in radian_list]

    area = math.fsum(sin_list)

    return area


while True:
    input_count = int(input())

    if input_count == 0:
        break

    input_list1 = [int(input()) for _ in range(input_count - 1)]
    area1 = calculate_area(input_list1)

    input_count = int(input())
    input_list2 = [int(input()) for _ in range(input_count - 1)]
    area2 = calculate_area(input_list2)

    if math.isclose(area1, area2):
        print(SAME)
    elif area1 > area2:
        print(ONE_BIGGER_TWO)
    else:
        print(TWO_BIGGER_ONE)

Python: # AOJ 0166: Area of Polygon
# Python3 2018.6.18 bal4u

import math
M = 0.00872664625997164788461845384244
EPS = 1e-8

a = [0]*2
s = [0.0]*2
while True:
	eof = False
	for i in range(2):
		s[i] = a[i] = 0;
		n = int(input())
		if n == 0:
			eof = True
			break
		for j in range(1, n):
			v = int(input())
			a[i] += v
			s[i] += math.sin(M*v)*math.cos(M*v)
		v = 360-a[i]
		s[i] += math.sin(M*v)*math.cos(M*v)
	if eof: break
	if abs(s[1]-s[0]) <= EPS: print(0)
	elif s[1] >= s[0]: print(2)
	else: print(1);

Python: import math

"""
import decimal
quantizeで1つずつ丸めていく?
"""

ONE_BIGGER_TWO = 1
TWO_BIGGER_ONE = 2
SAME = 0


def calculate_area(input_list):
    radian_list = [math.radians(item) for item in input_list]
    sin_list = [math.sin(item) for item in radian_list]
    area = math.fsum(sin_list)

    return area


while True:
    input_count = int(input())

    if input_count == 0:
        break

    input_list1 = [int(input()) for _ in range(input_count - 1)]
    area1 = calculate_area(input_list1)

    input_count = int(input())
    input_list2 = [int(input()) for _ in range(input_count - 1)]
    area2 = calculate_area(input_list2)

    if math.isclose(area1, area2):
        print(SAME)
    elif area1 > area2:
        print(ONE_BIGGER_TWO)
    else:
        print(TWO_BIGGER_ONE)

Python: from math import *
def area(x):
    ret=0.
    theta = 360.
    for i in range(x-1):
        tmp=float(input())
        theta-=tmp
        tmp=tmp*pi/180.
        ret+=(sin(tmp/2)*cos(tmp/2))
    theta=pi*theta/180.
    ret+=sin(theta/2)*cos(theta/2);
    return ret;
while 1:
    m=int(input())
    if m==0:break
    a=area(m)
    b=area(int(input()))
    print(0 if a==b else (1 if a>b else 2))

Python: import math

ONE_BIGGER_TWO = 1
TWO_BIGGER_ONE = 2
SAME = 0


def calculate_area(input_list):
    last = 360 - sum(input_list)
    input_list.append(last)

    radian_list = [math.radians(item) for item in input_list]
    sin_list = [math.sin(item) for item in radian_list]

    area = sum(sin_list)

    return area


while True:
    input_count = int(input())

    if input_count == 0:
        break

    input_list1 = [int(input()) for _ in range(input_count - 1)]
    area1 = calculate_area(input_list1)

    input_count = int(input())
    input_list2 = [int(input()) for _ in range(input_count - 1)]
    area2 = calculate_area(input_list2)

    if area1 == area2:
        print(SAME)
    elif area1 > area2:
        print(ONE_BIGGER_TWO)
    else:
        print(TWO_BIGGER_ONE)

Python: from math import sin, radians

ONE_BIGGER_TWO = 1
TWO_BIGGER_ONE = 2
SAME = 0


def calculate_area(input_list):
    radian_list = [radians(item) for item in input_list]
    sin_list = [sin(item) for item in radian_list]
    area = sum(sin_list)
    return area


while True:
    input_count = int(input())

    if input_count == 0:
        break

    input_list1 = [int(input()) for _ in range(input_count - 1)]
    area1 = calculate_area(input_list1)

    input_count = int(input())
    input_list2 = [int(input()) for _ in range(input_count - 1)]
    area2 = calculate_area(input_list2)

    if area1 == area2:
        print(SAME)
    elif area1 > area2:
        print(ONE_BIGGER_TWO)
    else:
        print(TWO_BIGGER_ONE)

Python: from sys import float_info
from math import sin, radians

ONE_BIGGER_TWO = 1
TWO_BIGGER_ONE = 2
SAME = 0


def calculate_area(input_list):
    radian_list = [radians(item) for item in input_list]
    sin_list = [sin(item) for item in radian_list]
    area = sum(sin_list)

    return area


while True:
    input_count = int(input())

    if input_count == 0:
        break

    input_list1 = [int(input()) for _ in range(input_count - 1)]
    area1 = calculate_area(input_list1)

    input_count = int(input())
    input_list2 = [int(input()) for _ in range(input_count - 1)]
    area2 = calculate_area(input_list2)

    if area1 - area2 < float_info.epsilon:
        print(SAME)
    elif area1 > area2:
        print(ONE_BIGGER_TWO)
    else:
        print(TWO_BIGGER_ONE)

Python: from math import sin, pi
def calc(n):
    s = a = 0
    V = []
    for i in range(n-1):
        v = int(input())
        s += v
        a += sin(v*pi/180)
        V.append(v)
    V.append(360-s)
    a += sin((360-s)*pi/180)
    return a, sorted(V)
while 1:
    m = int(input())
    if m == 0:
        break
    a1, V1 = calc(m)
    n = int(input())
    a2, V2 = calc(n)
    if V1 == V2 or a1 == a2:
        print(0)
    elif a1 < a2:
        print(2)
    else:
        print(1)

C++: #include <iostream>
#include <stdio.h>
#include <math.h>
#define PI 3.14159265
using namespace std;

int main() {
 double h[2],g,s;
 int n,i,j;
 while(true) {
	 for (i=0;i<2;i++) {
		 cin >> n;
		 h[i]=0;
		 if (n==0) return 0;
		 for (j=0,s=0;j<n-1;j++) {
			 cin >> g; s+=g;
			 h[i]+=sin(PI*g/180);
		 }
         h[i]+=sin(PI*(360-s)/180);
	 }
	 cout << (h[0]>h[1])+(h[0]<h[1])*2 << endl;
 }
 return 0;
 }

C++: #include <iostream>
#include <cmath>

using namespace std;

#define PI 3.14159265358979323846264338327950288

int main(){

	int m, n;
	int v, vsum;
	double area1=0, area2=0;

	while(1){

		cin >> m;
		if(m == 0) break;

		vsum = 0;
		for(int i = 0; i < m - 1; i++){
			cin >> v;
			vsum += v;
			area1 += sin(v * PI / 180.0);
		}
		area1 += sin((360 - vsum) * PI / 180.0);

		cin >> n;

		vsum = 0;
		for(int i = 0; i < n - 1; i++){
			cin >> v;
			vsum += v;
			area2 += sin(v * PI / 180.0);
		}
		area2 += sin((360 - vsum) * PI / 180.0);

		if(area1 == area2) cout << "0" << endl;
		else if(area1 > area2) cout<< "1" << endl;
		else cout<< "2" << endl;

	}

	return 0;
}