Go: package main

import "fmt"

func main() {
	var x1, x2, x3, y1, y2, y3, xp, yp float64
	for {
		v, _ := fmt.Scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &xp, &yp)
		// println(x1, x2, x3, y1, y2, y3, xp, yp)
		if v != 8 {
			break
		}
		ok1 := true
		ok2 := true
		if (x2-x1)*(yp-y1)-(xp-x1)*(y2-y1)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if (x3-x2)*(yp-y2)-(xp-x2)*(y3-y2)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if (x1-x3)*(yp-y3)-(xp-x3)*(y1-y3)<0 {
			ok1 = false
		} else {
			ok2 = false
		}
		if ok1 || ok2 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

Python: try:
    while True:
        x1, y1, x2, y2, x3, y3, xp, yp = map(float, input().split())
        a = complex(x1, y1)
        b = complex(x2, y2)
        c = complex(x3, y3)
        p = complex(xp, yp)
        s1 = ((a - p).conjugate() * (b - p)).imag
        s2 = ((b - p).conjugate() * (c - p)).imag
        s3 = ((c - p).conjugate() * (a - p)).imag
        if (s1 > 0) ^ (s2 > 0) == False and (s2 > 0) ^ (s3 > 0) == False:
            print('YES')
        else:
            print("NO")
except EOFError:
    exit()

Python: while True:
    try:
        x1, y1, x2, y2, x3, y3, xp, yp = list(map(float, input().split()))

        sign = lambda x1, y1, x2, y2, x3, y3: (x1 - x3) * (y2 - y3) - (x2 - x3) * (y1 - y3)
        b1 = sign(xp, yp, x1, y1, x2, y2) < 0.0
        b2 = sign(xp, yp, x2, y2, x3, y3) < 0.0
        b3 = sign(xp, yp, x3, y3, x1, y1) < 0.0


        if b1 == b2 and b2 == b3:
            print("YES")
        else:
            print("NO")
    except:
        break

Python: g=lambda a,b:abs(a[0]*b[1]-a[1]*b[0])

while True:
    t=input()
    if t=="":break
    l=[float(i) for i in t.split()]
    ba=[l[0]-l[2],l[1]-l[3]]
    ab=[-i for i in ba]
    cb=[l[2]-l[4],l[3]-l[5]]
    bc=[-i for i in cb]
    ca=[l[0]-l[4],l[1]-l[5]]
    ac=[-i for i in ca]
    ap=[l[6]-l[0],l[7]-l[1]]
    bp=[l[6]-l[2],l[7]-l[3]]
    cp=[l[6]-l[4],l[7]-l[5]]
    if g(ab,ac)<g(ab,ap) or g(ba,bc)<g(ba,bp):
        print("NO")
    else:
        print("YES")

Python: def cross(x, y):
    return (x.conjugate() * y).imag

def inside_triangle(p, x, y, z):
    a = cross(y-x, p-y)
    b = cross(z-y, p-z)
    c = cross(x-z, p-x)
    if a*b > 0 and b*c > 0:
        return True
    return False

import sys

for line in sys.stdin:
    x1, y1, x2, y2, x3, y3, xp, yp = map(float, line.split())
    x = complex(x1, y1)
    y = complex(x2, y2)
    z = complex(x3, y3)
    p = complex(xp, yp)
    if inside_triangle(p, x, y, z):
        print('YES')
    else:
        print('NO')

Python: import math
while True:
    try:
        x1, y1, x2, y2, x3, y3, xp, yp = map(float, input().split())
        x = [x1, x3, x3, x1]
        y = [y1, y2, y3, y1]
        x = list(map(lambda x:x-xp, x))
        y = list(map(lambda y:y-yp, y))
        cos = lambda a1,a2,b1,b2:(a1*b1+a2*b2)/((a1**2+a2**2)**0.5*(b1**2+b2**2)**0.5)
        if sum(math.acos(cos(x[i], y[i], x[i+1], y[i+1])) for i in range(3)) < 2 * math.pi - 1e-5:
            print('NO')
        else:
            print('YES')
    except:
        break

Python: import math

def tri(x1, y1, x2, y2, x3, y3):
    return math.fabs((x2-x1)*(y3-y1) - (y2-y1)*(x3-x1)) / 2

while True:
    try:
        x1, y1, x2, y2, x3, y3, xp, yp = map(float, input().split())
    except:
        break
    abc = tri(x1, y1, x2, y2, x3, y3)
    abp = tri(x1, y1, x2, y2, xp, yp)
    acp = tri(x1, y1, x3, y3, xp, yp)
    bcp = tri(x2, y2, x3, y3, xp, yp)
    x, y = int(abc*pow(10, 5)), int((abp+acp+bcp)*pow(10, 5))
    print("YES" if x >= y else "NO")

Python: while True:
  try:
    x1, y1, x2, y2, x3, y3, xp, yp = map(float, input().split())
  except EOFError:
    break
  vec_b = [x2-x1, y2-y1]
  vec_c = [x3-x1, y3-y1]
  vec_p = [xp-x1, yp-y1]
  a = (vec_p[0]*vec_c[1] - vec_p[1]*vec_c[0]) / (vec_b[0]*vec_c[1] - vec_b[1]*vec_c[0])
  b = (vec_p[0]*vec_b[1] - vec_p[1]*vec_b[0]) / (vec_b[1]*vec_c[0] - vec_b[0]*vec_c[1])
  if ((a > 0) and (b > 0) and (a+b < 1)):
    print("YES")
  else:
    print("NO")

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

def norm(x1,y1,x2,y2):
    r = math.sqrt((x2 - x1)**2 + (y2 - y1)**2)
    return r

def judge(x1,y1,x2,y2,x3,y3,xp,yp):
    r1 = norm(x1,y1,x2,y2)
    r2 = norm(x2,y2,x3,y3)
    r3 = norm(x3,y3,x1,y1)

    d1 = norm(xp,yp,x1,y1)
    d2 = norm(xp,yp,x2,y2)
    d3 = norm(xp,yp,x3,y3)

    if d1 > r1 or d1 > r3:
        print('NO')
    elif d2 > r1 or d2 > r2:
        print('NO')
    elif d3 > r3 or d3 > r2:
        print('NO')
    else:
        print('YES')

array = []
for i in sys.stdin:
    array.append(i)

for i in range(len(array)):
    tmp = array[i]
    x1,y1,x2,y2,x3,y3,xp,yp = map(float,tmp.split(' '))
    judge(x1,y1,x2,y2,x3,y3,xp,yp)

Python: def r(a, b, c, d, e, f):
    return a * (d-f) + c * (f-b) + e * (b-d) > 0

while True:
    try: line = list(map(float, input().split()))
    except: break
    
    x1, y1, x2, y2, x3, y3, xp, yp = line
    abc = r(x1, y1, x2, y2, x3, y3)
    pab = r(xp, yp, x1, y1, x2, y2)
    pbc = r(xp, yp, x2, y2, x3, y3)
    pca = r(xp, yp, x3, y3, x1, y1)

    print('YES' if abc == pab == pbc == pca else 'NO')

Python: while True:
  x1,y1,x2,y2,x3,y3,xp,yp=map(float,input().split())
  if xp<0 or yp<0:
    print('No')
  else:
    print('Yes')

Python: def checker(x1,y1,x2,y2,xp,yp):
	vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1)
	if vec > 0:
		return 1
	elif vec < 0:
		return -1

while True:
	try:
		x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split())
	except EOFError:
		break
	r = checker(x1,y1,x2,y2,xp,yp)
	r += checker(x2, y2, x3, y3, xp, yp)
	r += checker(x3, y3, x1, y1, xp, yp)
	if r == 3 or r == -3:
		print("YES")
	else:
		print("NO")

Python: def r(x1, y1, x2, y2, x3, y3):
    return x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2) > 0

while True:
    try:
        line = input()
    except:
        break

    x1, y1, x2, y2, x3, y3, xp, yp = map(float, line.strip().split())

    abc = r(x1, y1, x2, y2, x3, y3)
    pab = r(xp, yp, x1, y1, x2, y2)
    pbc = r(xp, yp, x2, y2, x3, y3)
    pca = r(xp, yp, x3, y3, x1, y1)

    print('YES' if abc == pab == pbc == pca else 'NO')

Python: # AOJ 0012 A Point in a Triangle
# Python3 2018.6.17 bal4u

EPS = 0.0001

# a, b, はラインの同一側にあるか
def is_atSameSide(a, b, line):
	sa = (line[1].real-line[0].real)*(a.imag-line[0].imag) \
		 + (line[1].imag-line[0].imag)*(line[0].real-a.real);
	sb = (line[1].real-line[0].real)*(b.imag-line[0].imag) \
		 + (line[1].imag-line[0].imag)*(line[0].real-b.real);
	if -EPS <= sa and sa <= EPS: return False 		 # a in line
	if -EPS <= sb and sb <= EPS: return False 		 # b in line
	if sa*sb >= 0: return True           # a,b at same side
	return False  # -1;
	
while True:
	try: p = list(map(float, input().split()))
	except: break
	
	p1 = complex(p[0], p[1])
	p2 = complex(p[2], p[3])
	p3 = complex(p[4], p[5])
	pp = complex(p[6], p[7])
	if is_atSameSide(p3, pp, [p1,p2]) and \
	   is_atSameSide(p1, pp, [p2,p3]) and \
	   is_atSameSide(p2, pp, [p3,p1]): print('YES')
	else: print('NO')

Python: while 1:
    try:
        x1,y1,x2,y2,x3,y3,xp,yp=map(float,input().split())
        a=((x1-x2)**2+(y1-y2)**2)**0.5
        b=((x2-x3)**2+(y2-y3)**2)**0.5
        c=((x3-x1)**2+(y3-y1)**2)**0.5
        s=(a+b+c)/2
        S=(s*(s-a)*(s-b)*(s-c))**0.5
        d=((x1-xp)**2+(y1-yp)**2)**0.5
        e=((x2-xp)**2+(y2-yp)**2)**0.5
        f=((x3-xp)**2+(y3-yp)**2)**0.5
        sa=(a+d+e)/2
        sb=(b+e+f)/2
        sc=(c+f+d)/2
        Sa=(sa*(sa-a)*(sa-d)*(sa-e))**0.5
        Sb=(sb*(sb-b)*(sb-e)*(sb-f))**0.5
        Sc=(sc*(sc-c)*(sc-f)*(sc-d))**0.5
        Sp=Sa+Sb+Sc
        if abs(S-Sp)<=0.001**2:
            print("YES")
        else:
            print("NO")
    except:break

Python: import sys
def f(h,i,j,k):z=(j-h)*(y-k)-(k-i)*(x-j);return([-1,1][z>0],0)[z==0]
for e in sys.stdin:
 p,q,r,s,t,u,x,y=map(float,e.split())
 print(['NO','YES'][f(p,q,r,s)==f(r,s,t,u)==f(t,u,p,q)])