Go: package main

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

func check(x, y, x1, y1, x2, y2 float64) float64 {
	return (x2-x1)*y - (y2-y1)*x + x1*y2 - x2*y1
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	a := make([]float64, 8)
	for scanner.Scan() {
		info := strings.Split(scanner.Text(), ",")
		for j := 0; j < 8; j++ {
			a[j], _ = strconv.ParseFloat(info[j], 64)
		}
		if check(a[0], a[1], a[2],a[3], a[6], a[7])*check(a[4], a[5], a[2], a[3], a[6], a[7]) < 0 && check(a[6], a[7], a[0], a[1], a[4], a[5])*check(a[2],a[3], a[0], a[1], a[4], a[5]) < 0 {
			fmt.Println("YES")	
		} else {
			fmt.Println("NO")
		}
	}
}

Python: def get_data():
    xa,ya,xb,yb,xc,yc,xd,yd = map(float,input().split(','))
    return xa,ya,xb,yb,xc,yc,xd,yd

def dist(x1,y1,x2,y2):
    d = ((x2-x1)**2 + (y2-y1)**2)**0.5
    return d
    
def convex(xa,ya,xb,yb,xc,yc,xd,yd):
    dab = dist(xa,ya,xb,yb)
    dac = dist(xa,ya,xc,yc)
    dad = dist(xa,ya,xd,yd)
    dbc = dist(xb,yb,xc,yc)
    dbd = dist(xb,yb,xd,yd)
    dcd = dist(xc,yc,xd,yd)
    if dab > dac and dad > dac:
        print('NO')
    elif dab > dbd and dbc > dbd:
        print('NO')
    elif dbc > dac and dcd > dac:
        print('NO')
    elif dad > dbd and dcd > dbd:
        print('NO')
    else:
        print('YES')
    return 0

while True:
    try:
        xa,ya,xb,yb,xc,yc,xd,yd = get_data()
        convex(xa,ya,xb,yb,xc,yc,xd,yd)
    except EOFError:
        break

Python: import sys
def sign(x):
    if x>0: s=1
    elif x<0: s=-1
    else: s=0
    return s

def f(p1,p2,p3):
    x1,y1 = p1
    s = sign((p3[1]-y1)*(p2[0]-x1)-(p2[1]-y1)*(p3[0]-x1))
    return s

for s in sys.stdin:
    D = map(float, s.split(","))
    p1 = D[0:2]
    p2 = D[2:4]
    p3 = D[4:6]
    p4 = D[6:8]
    x = f(p1,p3,p2) != f(p1,p3,p4) and f(p2,p4,p1) != f(p2,p4,p3)
    print ["NO","YES"][x]

Python: import sys
for line in sys.stdin:
    try:
        p = list(map(float, line.split(',')))
    except:
        break
    v = [p[i] - p[(i + 2) % 8] for i in range(8)]
    ip = [v[j] * v[(j + 3) % 8] - v[j + 1] * v[(j + 2) % 8] > 0 for j in range(0,8,2)]
    if sum(ip) == 0 or sum(ip) == 4:
        print('YES')
    else:
        print('NO')

Python: while True:
  try:
    data = list(map(float,input().split(",")))
  except EOFError:
    break
  vec1 = [data[2]-data[0],data[3]-data[1]]
  vec2 = [data[4]-data[0],data[5]-data[1]]
  vec3 = [data[6]-data[0],data[7]-data[1]]
  a = (vec2[0]*vec3[1] - vec2[1]*vec3[0]) / (vec1[0]*vec3[1] - vec1[1]*vec3[0])
  b = (vec2[0]*vec1[1] - vec2[1]*vec1[0]) / (vec1[1]*vec3[0] - vec1[0]*vec3[1])
  if (a < 0 or b < 0) or a+b < 1.0:
    print("NO")
  else:
    print("YES")

Python: while True:
    try:
        x_a, y_a, x_b, y_b, x_c, y_c, x_d, y_d = map(float, input().split(","))
        ab = [x_b - x_a, y_b - y_a]
        bc = [x_c - x_b, y_c - y_b]
        cd = [x_d - x_c, y_d - y_c]
        da = [x_a - x_d, y_a - y_d]
        dot_a = -(ab[0]*da[0] + ab[1]*da[1])
        dot_b = -(bc[0]*ab[0] + bc[1]*ab[1])
        dot_c = -(cd[0]*bc[0] + cd[1]*bc[1])
        dot_d = -(da[0]*cd[0] + da[1]*cd[1])
        if dot_a*dot_b*dot_c*dot_d < 0:
            print("NO")
        else:
            print("YES")
    except:
        break

Python: while True:
    try:
        lst = list(map(float, input().split(',')))
        xa, ya = lst[0], lst[1]
        xb, yb = lst[2], lst[3]
        xc, yc = lst[4], lst[5]
        xd, yd = lst[6], lst[7]

        ans1 = ((yc - ya)*xb - (xc - xa)*yb + (xc * ya - xa * yc))
        ans2 = ((yc - ya)*xd - (xc - xa)*yd + (xc * ya - xa * yc))
        ans3 = ((yb - yd)*xa - (xb - xd)*ya + (xb * yd - xd * yb))
        ans4 = ((yb - yd)*xc - (xb - xd)*yc + (xb * yd - xd * yb))

        if ans1*ans2 > 0 or ans3*ans4 > 0:
            print("NO")

        else:
            print("YES")

    except EOFError:
        break

Python: while True:
    try:
        x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split(','))
        p = (x3 - x4) * (y1 - y3) + (y3 - y4) * (x3 - x1)
        q = (x3 - x4) * (y2 - y3) + (y3 - y4) * (x3 - x2)
        r = (x1 - x2) * (y3 - y1) + (y1 - y2) * (x1 - x3)
        s = (x1 - x2) * (y4 - y1) + (y1 - y2) * (x1 - x4)
        if p * q < 0 and r * s < 0:
            print("YES")
        else:
            print("NO")
    except EOFError: break

Python: import sys
for e in sys.stdin:
 e=list(map(float,e.split(',')));f=0
 for i in range(0,8,2):
  if(e[i]-e[(2+i)%8])*(e[(4+i)%8]-e[(2+i)%8])+(e[1+i]-e[(3+i)%8])*(e[(5+i)%8]-e[(3+i)%8])<0:f=1
 print(['YES','NO'][f])

Python: #凸包を求める

def quickhull(l,r,s,k):
    if not s:
        return
    su = []
    sd = []
    a = (r[0]-l[0],r[1]-l[1])
    for x,y in s:
        b = (x-l[0],y-l[1])
        cro = cross(a,b)
        if cro > 0:
            su.append((x,y)) #上半分
        elif cro < 0:
            sd.append((x,y)) #下半分

    if su:
        c,d = direction(l,r,su[0])
        p = su[0]
        for i in range(1,len(su)):
            c_,d_ = direction(l,r,su[i])
            if c*d_ < c_*d:
                c,d = c_,d_
                p = su[i]
        k.append(tuple(p)) #もっとも離れた点を凸包の頂点に追加
        b = (l[0]-p[0],l[1]-p[1])
        c = (p[0]-r[0],p[1]-r[1])
        s1 = []
        s2 = []
        for x,y in su:
            b_ = (x-p[0],y-p[1])
            c_ = (x-r[0],y-r[1])
            cro_b,cro_c = cross(b,b_),cross(c,c_)
            if cro_b >= 0 and cro_c >= 0: #三角形内部判定
                continue
            else:
                if cro_b < 0:
                    s1.append((x,y))
                elif cro_c < 0:
                    s2.append((x,y))
        quickhull(l,p,s1,k) #再帰
        quickhull(p,r,s2,k)

    if sd:
        c,d = direction(l,r,sd[0])
        p = sd[0]
        for i in range(1,len(sd)):
            c_,d_ = direction(l,r,sd[i])
            if c*d_ < c_*d:
                c,d = c_,d_
                p = sd[i]
        k.append(tuple(p)) #もっとも離れた点を凸包の頂点に追加
        b = (l[0]-p[0],l[1]-p[1])
        c = (p[0]-r[0],p[1]-r[1])
        s1 = []
        s2 = []
        for x,y in sd:
            b_ = (x-p[0],y-p[1])
            c_ = (x-r[0],y-r[1])
            cro_b,cro_c = cross(b,b_),cross(c,c_)
            if cro_b <= 0 and cro_c <= 0: #三角形内部判定(ベクトルの向きにより上下で判定が異なることに注意)
                continue
            else:
                if cro_b > 0:
                    s1.append((x,y))
                elif cro_c > 0:
                    s2.append((x,y))
        quickhull(l,p,s1,k) #再帰
        quickhull(p,r,s2,k)
    return k

def cross(a,b): #外積
    return a[0]*b[1]-a[1]*b[0]

def direction(l,r,p): #点と直線の距離
    a = r[1]-l[1]
    b = l[0]-r[0]
    return (a*(p[0]-l[0])+b*(p[1]-l[1]))**2, a**2+b**2 #分子の2乗,分母の2乗
while 1:
    try:
        t = [float(x) for x in input().split(",")]
        s = []
        for i in range(len(t)//2):
            s.append((t[2*i],t[2*i+1]))
        s.sort()
        l = tuple(s.pop(0))
        r = tuple(s.pop(-1))
        k = quickhull(l,r,s,[l,r])
        if len(k) < 4:
            print("NO")
        else:
            print("YES")
    except:
        quit()

Python: while True:
    try:
        x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split(','))
        p = (x3 - x4) * (y1 - y3) + (y3 - y4) * (x3 - x1)
        q = (x3 - x4) * (y2 - y3) + (y3 - y4) * (x3 - x2)
        r = (x1 - x2) * (y3 - y1) + (y1 - y2) * (x1 - x3)
        s = (x1 - x2) * (y4 - y1) + (y1 - y2) * (x1 - x4)
        if p * q < 0 or r * s < 0:
            print("NO")
        else:
            print("YES")
    except EOFError: break

Python: import fileinput

for line in fileinput.input():
    xa, ya, xb, yb, xc, yc, xd, yd = map(float, line.split(','))
    xab, yab, xbc, ybc, xcd, ycd, xda, yda = xb - xa, yb - ya, xc - xb, yc - yb, xd - xc, yd - yc, xa - xd, ya - yd
    ab = xab * ybc - xbc * yab
    bc = xbc * ycd - xcd * ybc
    cd = xcd * yda - xda * ycd
    da = xda * yab - xab * yda
    print('YES' if ab * bc > 0 and ab * cd > 0 and ab * da > 0 else 'NO')