Go: ///
// File:  0582.go
// Author: ymiyamoto
//
// Created on Wed Feb 28 22:51:48 2018
//
package main

import (
	"bufio"
	"fmt"
	"os"
)

const (
	steep = iota
	orth
	obtuse
)

func max(a, b, c int) (int, int, int) {
	if a < b {
		if b < c {
			return c, a, b
		} else {
			return b, c, a
		}
	} else {
		if a < c {
			return c, a, b
		} else {
			return a, b, c
		}
	}
}

func triangle(a, b, c int) int {
	if a*a == b*b+c*c {
		return orth
	} else if b*b+c*c-a*a > 0 {
		return steep
	} else {
		return obtuse
	}
}

func main() {
	s := bufio.NewScanner(os.Stdin)

	var num, st, or, ob int
	for s.Scan() {
		var a, b, c int
		fmt.Sscan(s.Text(), &a, &b, &c)

		m, n1, n2 := max(a, b, c)
		if m < n1+n2 {
			switch triangle(m, n1, n2) {
			case steep:
				st++
			case orth:
				or++
			case obtuse:
				ob++
			}
			num++
		} else {
			break
		}
	}
	fmt.Println(num, or, st, ob)
}

Python: from sys import stdin
tri, rig, small, large = 0, 0, 0, 0
for line in stdin:
    line = list(map(int, line.split()))
    line.sort()
    if line[0] + line[1] <= line[2]:
        break
    tri += 1
    tmp = line[0] ** 2 + line[1] ** 2 - line[2] ** 2
    if tmp == 0:
        rig += 1
    elif tmp < 0:
        large += 1
    else:
        small += 1
print(tri, rig, small, large)

Python: f = True
cnt = 0
l = [0,0,0]
while f:
    t = [int(s) for s in input().split()]
    t.sort()
    if t[0]+t[1] <= t[2]:
        f = False
        break
    if t[0]**2+t[1]**2 > t[2]**2:
        l[0]+=1
    elif t[0]**2+t[1]**2 == t[2]**2:
        l[1]+=1
    else:
        l[2]+=1
print(sum(l),l[0],l[1],l[2])

Python: import sys
import fileinput
import math
from collections import Counter
from decimal import Decimal

RADIAN180 = Decimal(math.pi)
ANGLE90 = 90

counter = Counter()


def is_triangle(edges):
    return edge[0] + edge[1] > edge[2] and \
           edge[1] + edge[2] > edge[0] and \
           edge[2] + edge[0] > edge[1]


def calculate_radian(edges):
    edge.sort()
    radian = []

    s = sum(edge) / 2
    s = Decimal.sqrt(s * (s - edge[0]) * (s - edge[1]) * (s - edge[2]))
    h = 2 * s / edge[2]

    radian.append(Decimal(math.asin(h / edge[0])))
    radian.append(Decimal(math.asin(h / edge[1])))

    radian.append(RADIAN180 - sum(radian))

    return radian


for input_list in fileinput.input():

    edge = [Decimal(item) for item in input_list.split(" ")]

    if is_triangle(edge):

        counter["ALL"] = counter["ALL"] + 1

        radian = calculate_radian(edge)

        max_radian = max(radian)
        max_angle = Decimal(math.degrees(max_radian))
        max_angle = max_angle.quantize(Decimal(1.0))

        if max_angle < ANGLE90:
            counter["ACUTE"] += 1
        elif max_angle == ANGLE90:
            counter["RIGHT"] += 1
        else:
            counter["OBTUSE"] += 1
    else:
        for garbage in sys.stdin:
            pass
        break

print(counter['ALL'], counter["RIGHT"], counter["ACUTE"], counter["OBTUSE"])

Python: r=a=o=0
while 1:
 l,m,n=sorted(list(map(int,input().split())))
 if l+m<=n:break
 c=l*l+m*m-n*n
 if c>0:a+=1
 elif c<0:o+=1
 else:r+=1
print(sum(r,a,o),r,a,o)

Python: f = True
cnt = 0
l = [0,0,0]
while f:
    t = [int(s) for s in input().split()]
    t.sort()
    if (t[0]+t[1] <= t[2]) or t[0] == 0:
        f = False
        continue
    if t[0]**2+t[1]**2 > t[2]**2:
        l[0]+=1
    elif t[0]**2+t[1]**2 == t[2]**2:
        l[1]+=1
    else:
        l[2]+=1
print(sum(l),l[0],l[1],l[2])

Python: a,o,r = 0,0,0
while 1:
    s = sorted(list(map(int,input().split())))
    if(sum(s[:2]) <= s[2]): break
    b = s[0]**2 + s[1]**2 - s[2]**2
    if b > 0: a+=1
    elif b < 0:o+=1
    else: r+=1         
print(sum([a,o,r]),r,a,o)

Python: import sys
from enum import Enum, auto

class Triangle(Enum):
    NOTRIANGLE = 0
    ACUTE = 1
    RIGHT = 2
    OBTUSE = 3

def triangle_check(a, b, c):
    e1, e2, e3 = sorted([a, b, c], reverse=True)
    if e1 <= 0 or e2 <= 0 or e3 <= 0: return Triangle.NOTRIANGLE
    if e1 < e2 + e3: return Triangle.NOTRIANGLE
    if e1**2 == e2**2 + e3**2: return Triangle.RIGHT
    elif e1**2 < e2**2 + e3**2: return Triangle.ACUTE
    elif e1**2 > e2**2 + e3**2: return Triangle.OBTUSE

ans = [0 for i in range(4)]

lines = sys.stdin.readlines()
for line in lines:
    a, b, c = list(map(int, line.split(' ')))
    rst = triangle_check(a, b, c)
    if rst == 0:
        print(' '.join(list(map(str, ans))))
        break
    ans[0] += 1
    ans[int(rst)] += 1

Python: result = [0]*3
while True:
    a, b, c = sorted(map(int, input().split()))
    if a + b <= c:
        print(sum(result),*result)
        break
    flag = a ** 2 + b ** 2 - c*c
    if flag == 0:
        result[0] +=1
    elif flag >0:
        result[1] += 1
    else:
        result[2] += 1

Python: # -*- coding: utf-8 -*-
import sys
from math import sqrt


def calc_triangle_type(edge_length_str):
    edge_length = edge_length_str.split(" ")
    edge_length = list(map(lambda x: int(x), edge_length))
    edge_length_sorted = sorted(edge_length)
    if edge_length_sorted[0] + edge_length_sorted[1] <= edge_length_sorted[2]:
        return None
    right_angled_longest_edge = sqrt(
        edge_length_sorted[0] * edge_length_sorted[0] + edge_length_sorted[1] * edge_length_sorted[1])
    if edge_length_sorted[2] < right_angled_longest_edge:
        return 0
    elif edge_length_sorted[2] == right_angled_longest_edge:
        return 1
    else:
        return 2


def main():
    inputStr = sys.stdin.read()
    lines = inputStr.split("\n")
    counts_by_tryangle_type = {0: 0, 1: 0, 2: 0}
    total_triangle = 0
    for line in lines[:-1]:
        tryangle_type = calc_triangle_type(line)
        if tryangle_type is None:
            break
        counts_by_tryangle_type[tryangle_type] = counts_by_tryangle_type[tryangle_type] + 1
        total_triangle = total_triangle + 1
    print("{} {} {} {}".format(total_triangle,
                               counts_by_tryangle_type[1],
                               counts_by_tryangle_type[0],
                               counts_by_tryangle_type[2]))


if __name__ == '__main__':
    main()

Python: def main():
    eikaku = 0
    donkaku = 0
    chokkaku = 0

    while True:
        a, b, c = sorted([int(a) for a in input().split()])
        if a + b <= c:
            break
        d = a * a + b * b
        if d == c*c:
            chokkaku += 1
        elif d < c*c:
            donkaku += 1
        else:
            eikaku += 1

    print(" ".join([str(a) for a in [eikaku + donkaku + chokkaku, chokkaku, eikaku, donkaku]]))


if __name__ == '__main__':
    main()

Python: #input_f = "3 4 5\n2 1 2\n6 3 4\n1 1 1\n1 2 3"
while():
    input_f = input()

    counter = [0, 0, 0]

    def t_check(a,b,c):
        if a + b > c:
            if b + c > a:
                if a + c > b: return True
        return False



    def f_check(a_, b_, c_):
        tmp = []
        tmp.append(a_)
        tmp.append(b_)
        tmp.append(c_)
        sqrts = []
        for i in range(3):
            sqrts.append(tmp[i]**2)
        m = max(sqrts)
        s = sum(sqrts)

        print(m,s)

        if m == (s - m): return(0)
        if m > (s - m): return(2)
        if m < (s - m): return(1)


    t = input_f.split("\n")[i].split()
    fn, sn, tn = int(t[0]),int(t[1]),int(t[2])
    if t_check(fn,sn,tn):
        counter[f_check(fn,sn,tn)] += 1
    else: break
    

print(sum(counter),counter[0], counter[1], counter[2])

Python: import math
triangle_list = [0 for i in range(4)]
while(True):
    point = list(map(int,input().split()))
    point=sorted(point)
    z = math.sqrt(point[0]**2 + point[1]**2)

    if point[2] >= (point[1]+ point[0]):
        break
    elif point[2] < z:
        triangle_list[0] += 1
        triangle_list[2] += 1
    elif point[2] == z:
        triangle_list[0]+= 1
        triangle_list[1]+= 1
    elif point[2] > z:
        triangle_list[0] += 1
        triangle_list[3] += 1

print("{0[0]} {0[1]} {0[2]} {0[3]}".format(triangle_list))