submission_id
string
problem_id
string
status
string
code
string
input
string
output
string
problem_description
string
s948559548
p00021
Runtime Error
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) print("YES" if (x1 - x2) / (y1 - y2) == (x3 - x4) / (y3 - y4) else "NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s387594570
p00021
Runtime Error
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) print("YES" if abs((x1 - x2) / (y1 - y2)) == abs((x3 - x4) / (y3 - y4)) else "NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s294790697
p00021
Runtime Error
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) x2 -= x1 y2 -= y1 x4 -= x3 y4 -= y3 if x2 == 0 or x4 == 0: print("YES" if x2 == x4 == 0 else "NO") else: print("YES" if x2 / y2 == x4 / y4 else "NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s241150214
p00021
Runtime Error
for i in range(int(input())): s = list(map(float,input().split())) if (s[0] - s[2]) / (s[1] - s[3]) == (s[4] - s[6]) / (s[5] - s[7]): print('YES') else: print('NO')
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s765083054
p00021
Runtime Error
x = input() for i in xrange(x): grad1,grad2 = 0, 0 x1,y1,x2,y2,x3,y3,x4,y4 = map(float, raw_input().split()) grad1, grad2 = ((y1 - y2)/(x1 - x2)), ((y3 - y4)/(x3 - x4)) if grad1 == grad2: print "YES" else: print "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s109257416
p00021
Runtime Error
for i in xrange(input()): grad1, grad2 = 0, 0 x1,y1,x2,y2,x3,y3,x4,y4=map(float,raw_input().split()) grad1, grad2 = (y1 - y2)*(x3 - x4) , (y3 - y4)*(x1 - x2) if grad1 - grad2 == 0: print "YES" else: print "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s391565769
p00021
Runtime Error
# -*- coding: utf-8 -*- class Point_Class(): def __init__(self, x, y): self.x = x self.y = y def slope(p1, p2): return (p2.y-p1.y)/(p2.x-p1.x) n = int(raw_input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().split()) p1 = Point_Class(x1, y1) p2 = Point_Class(x2, y2) p3 = Point_Class(x3, y3) p4 = Point_Class(x4, y4) print "YES" if slope(p1, p2) == slope(p3, p4) else "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s251379144
p00021
Runtime Error
# -*- coding: utf-8 -*- import sys class Point_Class(): def __init__(self, x, y): self.x = x self.y = y def slope(p1, p2): return (p2.y-p1.y)/(p2.x-p1.x) if p2.x != p1.x else sys.intmax n = int(raw_input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().split()) p1 = Point_Class(x1, y1) p2 = Point_Class(x2, y2) p3 = Point_Class(x3, y3) p4 = Point_Class(x4, y4) print "YES" if slope(p1, p2) == slope(p3, p4) else "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s911120481
p00021
Runtime Error
class line(): def __init__(self): self.p={"x":0,"y":0} self.q={"x":0,"y":0} def setPoint(self,px,py,qx,qy): self.p["x"]=px self.p["y"]=py self.q["x"]=qx self.q["y"]=qy def getVector(self,rev=False): if(rev): return ((self.p["x"]-self.q["x"]),(self.p["y"]-self.q["y"])) else: return ((self.q["x"]-self.p["x"]),(self.q["y"]-self.p["y"])) def main(): l=line() m=line() for i in range(0,int(input())): (lambda x:(l.setPoint(*(x[0:4])),m.setPoint(*(x[4:8]))))(tuple(map(float,input().split(" ")))) if((l.getVector()==(0,0))or(m.getVector()==(0,0))): print("NO") elif((lambda l,m:(l[0]/m[0])==(l[1]/m[1]))(l.getVector(),m.getVector())): print("YES") else: print("NO") if __name__ == '__main__': main()
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s925092183
p00021
Runtime Error
n = int(input()) for i in range(n): x1,y1,x2,y2,x3,y3,x4,y4 = map(float, input().split()) if (y1-y2)/(x1-x2) == (y3-y4)/(x3-x4): print('YES') else: print('NO')
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s246204797
p00021
Runtime Error
n = int(input()) for i in range(n): x1,y1,x2,y2,x3,y3,x4,y4 = map(float, input().split()) if x1-x2 == 0 or x3-x4 ==0: if x1-x2 == 0 and x3-x4 ==0: print('YES') else: print('NO') if (y1-y2)/(x1-x2) == (y3-y4)/(x3-x4): print('YES') else: print('NO')
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s968213507
p00021
Runtime Error
N = (eval(input())) for _ in range(N): x1, y1, x2, y2, x3, y3, x4, y4 = [eval(item) for item in input().split()] if (x1 - x2)/(y1 - y2) == (x3 - x4)/(y3 - y4): print('YES') else: print('NO')
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s540000425
p00021
Runtime Error
N = (eval(input())) for _ in range(N): x1, y1, x2, y2, x3, y3, x4, y4 = [eval(item) for item in input().split()] if (x1 == x2 and x3 == x4) or (y1 == y2 and y3 == y4): print('YES') elif (x1 - x2)/(y1 - y2) == (x3 - x4)/(y3 - y4): print('YES') else: print('NO')
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s624833265
p00021
Runtime Error
N = eval(input()) for _ in range(N): x1, y1, x2, y2, x3, y3, x4, y4 = [eval(item) for item in input().split()] if (x1 == x2 and x3 == x4) or (y1 == y2 and y3 == y4): print('YES') elif (x1 - x2)/(y1 - y2) == (x3 - x4)/(y3 - y4): print('YES') else: print('NO')
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s867472313
p00021
Runtime Error
import math n = input() for i in xrange(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().split()) print "YES" if (y1 - y2) / (x1 - x2) == (y3 - y4) / (x3 - x4) else "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s990033500
p00021
Runtime Error
n = input() for i in xrange(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().split()) print "YES" if (y1 - y2) / (x1 - x2) == (y3 - y4) / (x3 - x4) else "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s462749416
p00021
Runtime Error
n = input() for i in xrange(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().split()) if (y1 - y2) / (x1 - x2) == (y3 - y4) / (x3 - x4): print "YES" else: "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s214655675
p00021
Runtime Error
# ????????????????????°?????? import sys def is_parallel(x1, y1, x2, y2, x3, y3, x4, y4): a1 = (y2 - y1) / (x2 - x1) a2 = (y4 - y3) / (x4 - x3) return a1 == a2 def main(): n = int(sys.stdin.readline().strip()) for _ in range(n): data = sys.stdin.readline().strip().split(' ') x1 = float(data[0]) y1 = float(data[1]) x2 = float(data[2]) y2 = float(data[3]) x3 = float(data[4]) y3 = float(data[5]) x4 = float(data[6]) y4 = float(data[7]) if is_parallel(x1, y1, x2, y2, x3, y3, x4, y4): print('YES') else: print('NO') if __name__ == '__main__': main()
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s681134116
p00021
Runtime Error
# ????????????????????°?????? import sys def is_parallel(x1, y1, x2, y2, x3, y3, x4, y4): d1x = x2 - x1 d1y = y2 - y1 d2x = x4 - x3 d2y = y4 - y3 if d1x != 0 and d2x != 0: a1 = d1y / d1x a2 = d2y / d2y return a1 == a2 if d1x == 0 and d2x == 0: return True return False def main(): n = int(sys.stdin.readline().strip()) for _ in range(n): data = sys.stdin.readline().strip().split(' ') x1 = float(data[0]) y1 = float(data[1]) x2 = float(data[2]) y2 = float(data[3]) x3 = float(data[4]) y3 = float(data[5]) x4 = float(data[6]) y4 = float(data[7]) if is_parallel(x1, y1, x2, y2, x3, y3, x4, y4): print('YES') else: print('NO') if __name__ == '__main__': main()
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s966651454
p00021
Runtime Error
num=int(input()) for i in range (num): info=list(map(float,input().split())) if info[2]==info[0]: if info[6]==info[4]: print("YES") else: print("NO") else: if (info[3]-info[1])/(info[2]-info[0])==(info[7]-info[5])/(info[6]-info[4]): print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s970399047
p00021
Runtime Error
for i in range(int(input())): l = list(map(float,input().split())) ab, cd = (l[2]-l[0])/(l[3]-l[1]), (l[6]-l[4])/(l[7]-l[5]) if ab==cd: print('YES') else: print('NO')
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s281284382
p00021
Runtime Error
for i in range(int(input())): l = list(map(float,input().split())) a,b,c,d = l[2]-l[0],l[3]-l[1],l[6]-l[4],l[7]-l[5] if b==0 or d==0: next if a/b==c/d: print('YES') else: print('NO')
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s616910459
p00021
Runtime Error
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = list(map(float, input().split())) s = [x2-x1, y2-y1] t = [x4-x3, y4-y3] if not (s[0] or t[0]): print("YES") continue if s[1]/s[0] == t[1]/t[0]: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s828680570
p00021
Runtime Error
n = int(raw_input()) for i in range(n): x0, y0, x1, y1, x2, y2, x3, y3 = raw_input().split() if float(y1-y0)/(x1-x0) == float(y3-y2)/(x3-x2): print 'YES' else: print 'NO'
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s127716592
p00021
Runtime Error
n = int(raw_input()) for i in range(n): x0, y0, x1, y1, x2, y2, x3, y3 = map(float, raw_input().split()) if float(y1-y0)/(x1-x0) == float(y3-y2)/(x3-x2): print 'YES' else: print 'NO'
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s341119049
p00021
Runtime Error
n = int(raw_input()) for i in range(n): x0, y0, x1, y1, x2, y2, x3, y3 = map(float, raw_input().split(' ')) if float(y1-y0)/(x1-x0) == float(y3-y2)/(x3-x2): print 'YES' else: print 'NO'
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s861523131
p00021
Runtime Error
while True: try: a=[float(i) for i in input().split()] except: break print("YES" if (a[3]-a[1])/(a[2]-a[0])==(a[7]-a[5])/(a[6]-a[4]) else "NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s301493776
p00021
Runtime Error
while True: try: a=[float(i) for i in input().split()] except: break dx1=a[2]-a[0] dy1=a[3]-a[1] dx2=a[6]-a[4] dy2=a[7]-a[5] if dx1==0 and dx2==0 or dy1/dx1==dy2/dx2: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s475221292
p00021
Runtime Error
while True: try: a=[float(i) for i in input().split()] except: break dx1=a[2]-a[0] dy1=a[3]-a[1] dx2=a[6]-a[4] dy2=a[7]-a[5] if dx1==0 or dx2==0: if dx1==0 and dx2==0: print("YES") else: print("NO") elif dy1/dx1==dy2/dx2: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s816353689
p00021
Runtime Error
# -*- coding:utf-8 -*- def check_para(x1,y1,x2,y2,x3,y3,x4,y4): k1 = (y2-y1)/(x2-x1) k2 = (y4-y3)/(x4-x3) if k1 == k2: print('YES') else: print('NO') n = int(input()) for i in range(n): x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split()) check_para(x1,y1,x2,y2,x3,y3,x4,y4)
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s594111180
p00021
Runtime Error
# -*- coding:utf-8 -*- def check_para(x1,y1,x2,y2,x3,y3,x4,y4): k1 = (y2-y1)/(x2-x1) k2 = (y4-y3)/(x4-x3) if abs(k1-k2) < 1e-10: print('YES') else: print('NO') n = int(input()) for i in range(n): x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split()) check_para(x1,y1,x2,y2,x3,y3,x4,y4)
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s517799363
p00021
Runtime Error
for _ in range(int(input())): ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split()) print(['NO','YES'][(by-ay)/(bx-ax)==(dy-cy)/(dx-cx)])
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s883878207
p00021
Runtime Error
def to_f(e): return float(e) n = int(raw_input().rstrip()) for i in range(n): line = raw_input().rstrip() l = map(to_f, line.split(" ")) x1 = l[0] y1 = l[1] x2 = l[2] y2 = l[3] x3 = l[4] y3 = l[5] x4 = l[6] y4 = l[7] m1 = (y2-y1)/(x2-x1) m2 = (y4-y3)/(x4-x3) if m1 == m2: print "YES" else: print "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s621090086
p00021
Runtime Error
n = int(input()) for i in range(n): line = list(map(float,input().split())) AB = (line[3] - line[1]) / (line[2] - line[0]) CD = (line[7] - line[5]) / (line[6] - line[4]) if round(AB - CD,8) == 0: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s380313361
p00021
Runtime Error
n = int(input()) for i in range(n): line = list(map(float,input().split())) if round(line[2] - line[0], 2) == 0: if round(line[6] - line[4], 2) == 0: print("YES") else: print("NO") else: AB = (line[3] - line[1]) / (line[2] - line[0]) CD = (line[7] - line[5]) / (line[6] - line[4]) if round(AB - CD, 8) == 0: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s696703158
p00021
Runtime Error
from fractions import Fraction def sroap(x1,y1,x2,y2): if x2 - x1 == 0: return float("inf") else: return Fraction(y2 - y1,x2 - x1) N = int(input()) for n in range(N): Ax,Ay,Bx,By,Cx,Cy,Dx,Dy = map(lambda x: round(x * 10 ** 5),(map(float,input().split()))) if sroap(Ax,Ay,Bx,By) == sroap(Cx,Cy,Dx,Dy): ????????????print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s447210616
p00021
Runtime Error
n=int(input()) for i in range(n): x1,y1,x2,y2,x3,y3,x4,y4=map(float,input().split()) if (y2-y1)/(x2-x1)==(y4-y3)/(x4-x3): print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s125547760
p00021
Runtime Error
for _ in range(int(input())) : x1, y1, x2, y2, x3, y3, x4, y4 = [float(__) for __ in input().split()] a, b = ((y2 - y1) / (x2 - x1)), ((y4 - y3) / (x4 - x3)) if a == b : print('YES') else : print('NO')
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s933695897
p00021
Runtime Error
import mth num = int(input()) for i in range(num): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split(' ')) aaa = (y1 - y2) * (x3 - x4) bbb = (y3 - y4) * (x1 - x2) if abs(aaa - bbb) <= 0: print('YES') else: print('NO')
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s650280416
p00021
Runtime Error
n = int(input()) for _ in range(n): ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split()) a1 = (ay-by)/(ax-bx) a2 = (cy-dy)/(cy-dy) if a1 == a2: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s255871746
p00021
Runtime Error
n = int(input()) ans = [] for _ in range(n): ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split()) a1 = (ay-by)/(ax-bx) a2 = (cy-dy)/(cy-dy) if a1 == a2: ans.append("YES") else: ans.append("NO") print(*ans, sep="\n")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s221498235
p00021
Runtime Error
n = int(input()) ans = [] for _ in range(n): ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split()) a1 = (ay - by) / (ax - bx) a2 = (cy - dy) / (cy - dy) if a1 == a2: ans.append("YES") else: ans.append("NO") print(*ans, sep="\n")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s355783254
p00021
Runtime Error
n = int(input()) ans = [] for _ in range(n): ax, ay, bx, by, cx, cy, dx, dy = map(float, input().split()) a1 = (ay - by) / (ax - bx) a2 = (cy - dy) / (cx - dx) if a1 == a2: ans.append("YES") else: ans.append("NO") print(*ans, sep="\n")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s269541586
p00021
Runtime Error
from fractions import Fraction def parallelism(x1, y1, x2, y2, x3, y3, x4, y4): a1 = Fraction((y2-y1), (x2-x1)) if (x2-x1) != 0 else float("inf") a2 = Fraction((y4-y3), (x4-x3)) if (x4-x3) != 0 else float("inf") if a1 == a2: return "YES" else: return "NO" if __name__ == "__main__": assert parallelism(0.0, 0.0, 1.0, 1.0, 1.0, 0.0, 2.0, 1.0) == "YES", "sample1" assert parallelism(3.0, 2.0, 9.0, 6.0, 13.0, 5.0, 7.0, 9.0) == "NO", "sample2" assert parallelism(3.0, 2.0, 9.0, 2.0, 13.0, 5.0, 7.0, 5.0) == "YES", "horizontal line" assert parallelism(3.0, 2.0, 3.0, 6.0, 13.0, 5.0, 13.0, 9.0) == "YES", "vertical line" n = int(input()) for _ in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) print(parallelism(x1, y1, x2, y2, x3, y3, x4, y4))
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s005388826
p00021
Runtime Error
from numpy import * ABs=[] CDs=[] n = int(input()) for i in range(n): x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4, = map(float, input().split()) AB = array([x_2 - x_1, y_2 - y_1]) CD = array([x_4 - x_3, y_4 - y_3]) ABs.append(AB) CDs.append(CD) for i in range(n): if linalg.norm(cross(ABs[i],CDs[i]))==0.0: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s403182269
p00021
Runtime Error
from math import isclose n = int(input()) for _ in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) if isclose((x2 - x1) * (y4 - y3) - (x4 - x3) * (y2 - y1), 0.0): print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s642712403
p00021
Runtime Error
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) if (y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3): print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s675720287
p00021
Runtime Error
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) if x1 == x2 and x3 == x4: print("YES") elif (y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3): print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s579653499
p00021
Runtime Error
import math if __name__ == '__main__': n = int(input()) for _ in range(n): x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split()) #print((y2-y1)/(x2-x1) - (y4-y3)/(x4-x3)) '''if math.fabs(x1 - x2) <= 0.00001 and math.fabs( x3 - x4) <= 0.00001: print("YES") elif math.fabs(x1 - x2) <= 0.00001: print("NO") elif math.fabs(x3 - x4) <= 0.00001: print("NO") else: ''' if math.fabs((y2-y1)/(x2-x1) - (y4-y3)/(x4-x3)) <= 0.00001: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s626107771
p00021
Runtime Error
import math if __name__ == '__main__': n = int(input()) for _ in range(n): x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split()) #print((y2-y1)/(x2-x1) - (y4-y3)/(x4-x3)) '''if math.fabs(x1 - x2) <= 0.00001 and math.fabs( x3 - x4) <= 0.00001: print("YES") elif math.fabs(x1 - x2) <= 0.00001: print("NO") elif math.fabs(x3 - x4) <= 0.00001: print("NO") else: ''' if math.fabs((y2-y1)//(x2-x1) - (y4-y3)//(x4-x3)) <= 0.00001: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s980597344
p00021
Runtime Error
def naiseki(x1,y1,z1,x2,y2,z2) if x1-x2+y1-y2+z1-z2 == 0: print("YES") else: print("NO") f = input().split() try: x1=f[0] y1=f[1] z1=f[2] x2=f[3] y2=f[4] z2=[f5] naiseki(x1,y1,z1,x2,y2,z2) except: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s568770783
p00021
Runtime Error
def naiseki(x1,y1,x2,y2,x3,y3,x4,y4) if (x1-x2)*(x3-x4)+(y1-y2)*(y3-y4) == 0: print("YES") else: print("NO") a = int(input()) for i in range(a): f = input().split() try: x1=f[0] y1=f[1] x2=f[2] y2=f[3] x3=f[4] y3=[f5] x4=f[6] y4=f[7] naiseki(x1,y1,x2,y2,x3,y3,x4,y4) except: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s472315596
p00021
Runtime Error
def naiseki(x1,y1,x2,y2,x3,y3,x4,y4) if (x1-x2)*(x3-x4)+(y1-y2)*(y3-y4) == 0: print("YES") else: print("NO") a = int(input()) for i in range(a): f = input().split() try: map(lambda:float(),f) x1=f[0] y1=f[1] x2=f[2] y2=f[3] x3=f[4] y3=[f5] x4=f[6] y4=f[7] naiseki(x1,y1,x2,y2,x3,y3,x4,y4) except: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s393659288
p00021
Runtime Error
def naiseki(x1,y1,x2,y2,x3,y3,x4,y4) if (x1-x2)*(x3-x4)+(y1-y2)*(y3-y4) == 0: print("YES") else: print("NO") a = int(input()) for i in range(a): f = input() try: g=map(lambda:float(),f.split()) x1=g[0] y1=g[1] x2=g[2] y2=g[3] x3=g[4] y3=gf5] x4=g[6] y4=g[7] naiseki(x1,y1,x2,y2,x3,y3,x4,y4) except: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s516822254
p00021
Runtime Error
import math def naiseki(x1,y1,x2,y2,x3,y3,x4,y4): if ((x2-x1)*(y4-y3)-(y2-y1)*(x4-x3)) == 0: print("YES") else: print("NO") a = int(input()) for i in range(a): f = map(float,raw_input().split()) try: g=f x1=g[0] y1=g[1] x2=g[2] y2=g[3] x3=g[4] y3=g[5] x4=g[6] y4=g[7] naiseki(x1,y1,x2,y2,x3,y3,x4,y4) except: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s478745791
p00021
Runtime Error
import math def naiseki(x1,y1,x2,y2,x3,y3,x4,y4): if ((x2-x1)*(y4-y3)-(y2-y1)*(x4-x3)) == 0: print("YES") else: print("NO") a = int(input()) f=[] for i in range(a): f.append(map(float,raw_input().split())) for g in f: try: x1=g[0] y1=g[1] x2=g[2] y2=g[3] x3=g[4] y3=g[5] x4=g[6] y4=g[7] naiseki(x1,y1,x2,y2,x3,y3,x4,y4) except: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s630322901
p00021
Runtime Error
import math def naiseki(x1,y1,x2,y2,x3,y3,x4,y4): if ((x2-x1)*(y4-y3)-(y2-y1)*(x4-x3)) == 0: print("YES") else: print("NO") a = int(raw_input()) f=[] for i in range(a): f.append(map(float,raw_input().split())) for g in f: try: x1=g[0] y1=g[1] x2=g[2] y2=g[3] x3=g[4] y3=g[5] x4=g[6] y4=g[7] naiseki(x1,y1,x2,y2,x3,y3,x4,y4) except: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s964814890
p00021
Runtime Error
def gaiseki(x1,y1,x2,y2,x3,y3,x4,y4): if ((x2-x1)*(y4-y3)-(y2-y1)*(x4-x3)) < 1e-10: print("YES") else: print("NO") a = int(input()) for i in range(a): g=(map(float,raw_input().split())) try: x1=g[0] y1=g[1] x2=g[2] y2=g[3] x3=g[4] y3=g[5] x4=g[6] y4=g[7] gaiseki(x1,y1,x2,y2,x3,y3,x4,y4) except: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s221741873
p00021
Runtime Error
a = int(input()) for i in range(0,a): g=(map(float,raw_input().split())) try: x1=g[0] y1=g[1] x2=g[2] y2=g[3] x3=g[4] y3=g[5] x4=g[6] y4=g[7] if ((x2-x1)*(y4-y3)-(y2-y1)*(x4-x3)) < 1e-10: print("YES") else: print("NO") except: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s166363928
p00021
Runtime Error
def gaiseki(x1,y1,x2,y2,x3,y3,x4,y4): if ((x2-x1)*(y4-y3)-(y2-y1)*(x4-x3)) < 1e-10: print("YES") else: print("NO") a = int(input()) for i in range(a): g=(map(float,raw_input().split())) x1=g[0] y1=g[1] x2=g[2] y2=g[3] x3=g[4] y3=g[5] x4=g[6] y4=g[7] gaiseki(x1,y1,x2,y2,x3,y3,x4,y4)
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s861030992
p00021
Runtime Error
a = int(input()) for i in range(a): x1,y1,x2,y2,x3,y3,x4,y4=list((map(float,raw_input().split()))) if ((x2-x1)*(y4-y3)-(y2-y1)*(x4-x3)) < 1e-10: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s934877178
p00021
Runtime Error
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = list(map(float, raw_input().split())) if abs(((y2-y1)*(x4-x3) - (x2-x1)*(y4-y3))) < 1e-10: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s133097880
p00021
Runtime Error
# coding=utf-8 points_list = list(map(float, input().split())) abx = points_list[2] - points_list[0] aby = points_list[3] - points_list[1] cdx = points_list[6] - points_list[4] cdy = points_list[7] - points_list[5] if abx == cdx and aby == cdy: print('YES') else: print('NO')
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s945279973
p00021
Runtime Error
# coding=utf-8 n = int(input()) for i in range(n): points_list = list(map(float, input().split())) abx = points_list[2] - points_list[0] aby = points_list[3] - points_list[1] cdx = points_list[6] - points_list[4] cdy = points_list[7] - points_list[5] if abx / cdx == aby / cdy: print('YES') else: print('NO')
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s109572367
p00021
Runtime Error
# coding=utf-8 n = int(input()) for i in range(n): points_list = list(map(float, input().split())) abx = points_list[2] - points_list[0] aby = points_list[3] - points_list[1] cdx = points_list[6] - points_list[4] cdy = points_list[7] - points_list[5] if cdx == 0: if cdy == 0: print('YES') else: print('NO') elif abx / cdx == aby / cdy: print('YES') else: print('NO')
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s379867405
p00021
Runtime Error
def calc(a): i1 = (a[3] - a[1]) / (a[2] - a[0]) i2 = (a[7] - a[5]) / (a[6] - a[4]) if i1 == i2: print("YES") else: print("NO") if __name__ == '__main__': N = int(input()) a = [] for i in range(0, N): a.append(list(map(float, input().split()))) calc(a[i])
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s785997251
p00021
Runtime Error
n=input() for i in range(0,n): zahyou=map(float,raw_input().split(" ")) a=(zahyou[3]-zahyou[1])/(zahyou[2]-zahyou[0]) b=(zahyou[7]-zahyou[5])/(zahyou[6]-zahyou[4]) if a==b or a==-b: print "YES" else: print "NO",
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s305031978
p00021
Runtime Error
n=int(raw_input()) for i in range(0,n): zahyou=map(float,raw_input().split(" ")) a=(zahyou[3]-zahyou[1])/(zahyou[2]-zahyou[0]) b=(zahyou[7]-zahyou[5])/(zahyou[6]-zahyou[4]) if a==b or a==-b: print "YES" else: print "NO",
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s225884487
p00021
Runtime Error
# -*- coding:utf-8 -*- n=int(raw_input()) for i in range(0,n): a,b,c,d,e,f,g,h=map(float,raw_input().split(" ")) t=(d-b)/(c-a) y=(h-f)/(g-e) if y==t or y==-t: print "YES" else: print "NO",
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s872803514
p00021
Runtime Error
# -*- coding:utf-8 -*- n=int(raw_input()) for i in range(0,n): a,b,c,d,e,f,g,h=map(float,raw_input().split(" ")) t=(d-b)/(c-a) y=(h-f)/(g-e) if y==t or y==-t: print "YES" else: print "NO",
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s387330312
p00021
Runtime Error
# -*- coding:utf-8 -*- n=int(raw_input()) for i in range(n): a,b,c,d,e,f,g,h=map(float,raw_input().split(" ")) t=(d-b)/(c-a) y=(h-f)/(g-e) if y==t or y==-t: print "YES" else: print "NO",
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s252326330
p00021
Runtime Error
# -*- coding:utf-8 -*- n=int(raw_input()) for i in range(n): a,b,c,d,e,f,g,h=map(float,raw_input().split()) t=(d-b)/(c-a) y=(h-f)/(g-e) if y==t or y==-t: print "YES" else: print "NO",
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s756036525
p00021
Runtime Error
count = int(input()) for i in range(count): x = list(map(float ,input().split())) x1=x[2]-x[0] y1=x[3]-x[1] x2=x[6]-x[4] y2=x[7]-x[5] if x1==0: if x2==0: print("YES") else: print("NO") else: if y1/x1==y2/x2: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s658283737
p00021
Runtime Error
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = [float(j) for j in input().split()] if x2 - x1 == 0: if x4 - x3 == 0: print("YES") else: print("NO") print("YES" if (y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3) else "NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s710832089
p00021
Runtime Error
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = [float(j) for j in input().split()] if x2 - x1 == 0.0: if x4 - x3 == 0.0: print("YES") else: print("NO") print("YES" if (y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3) else "NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s217107841
p00021
Runtime Error
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = [float(j) for j in input().split()] if x2 - x1 == 0.0: if x4 - x3 == 0.0: print("YES") else: print("NO") elif x4 - x3 == 0.0: print("NO") print("YES" if (y2 - y1) / (x2 - x1) == (y4 - y3) / (x4 - x3) else "NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s956143872
p00021
Runtime Error
def main(): n = int(input()) for i in range(n): x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split()) if (y2-y1)/(x2-x1) == (y4 - y3)/(x4 -x3): print("YES") else: print("NO") if __name__ == '__main__': main()
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s923288229
p00021
Runtime Error
n=int(input()) for i in range(n): x1,y1,x2,y2,x3,y3,x4,y4=map(float,input().split()) if ((y1-y2)/(x1-x2))==((y4-y3)/(x4-x3)) or (y1-y2)/(x1-x2)==((y3-y4)/(x3-x4)): print('YES') else: print('NO')
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s943654957
p00021
Runtime Error
for i in range(int(input())): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split(" ")) if (y1 - y2) / (x1 - x2) == (y4 - y3)/ (x4 - x3): print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s284434011
p00021
Runtime Error
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split(" ")) if (y1 - y2) / (x1 - x2) == (y4 - y3)/ (x4 - x3): print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s153306615
p00021
Runtime Error
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split(" ")) if abs((y1 - y2) / (x1 - x2) - (y4 - y3)/ (x4 - x3)) < 1e-10: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s342994245
p00021
Runtime Error
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split()) if abs((y1 - y2) / (x1 - x2) - (y4 - y3)/ (x4 - x3)) < 1e-10: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s425875337
p00021
Runtime Error
n=int(input()) for _ in range(n): p=[float(i) for i in input().split()] if round((p[3]-p[1])/(p[2]-p[0]),5)==round((p[7]-p[5])/(p[6]-p[4]),5):print("YES") else:print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s017759094
p00021
Runtime Error
n=int(input()) for _ in range(n): p=[float(i) for i in input().split()] if round((p[3]-p[1])/(p[2]-p[0]),5)==round((p[7]-p[5])/(p[6]-p[4]),5): print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s157945931
p00021
Runtime Error
n=int(input()) for j in range(n): p=[float(i) for i in input().split()] ab=round((p[3]-p[1])/(p[2]-p[0]),5) cd=round((p[7]-p[5])/(p[6]-p[4]),5) if ab==cd: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s016102868
p00021
Runtime Error
n=int(input()) for j in range(n): p=[float(i) for i in input().split()] ab=(p[3]-p[1])/(p[2]-p[0]) cd=(p[7]-p[5])/(p[6]-p[4]) if ab==cd: print("YES") else: print("NO")
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s456151412
p00021
Runtime Error
r=[] for i in range(int(input())): d=[float(i) for i in input().split()] if d[0]-d[2] != 0 and d[4]-d[6] != 0: a=(d[1]-d[3])/(d[0]-d[2]) b=(d[5]-d[7])/(d[4]-d[6]) if a==b:r.extend([1]) else:r.extend([0]) else if (d[0]==d[2] and d[4]==d[6]): r.extend([1]) else if (d[1]==d[3] and d[5]==d[7]): r.extend([1]) else: r.extend([0]) [print("YES") if i else print("NO") for i in r]
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s017955530
p00021
Runtime Error
for i in range(int(input())): x1,y1,x2,y2,x3,y3,x4,y4=map(float,raw_input().split()) ans,ans2=(y2-y1)/(x2-x1),(y4-y3)/(x4-x3) if ans==ans2: print "YES" else: print "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s966476429
p00021
Runtime Error
num =input() YN = [] for i in range(num): x = map(float, raw_input().split(' ')) if (x[0]-x[2])/(x[1]-x[3]) == (x[4]-x[6])/(x[5]-x[7]): YN.append('YES') else: YN.append('NO') for i in YN: print i
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s305247146
p00021
Runtime Error
num =input() for i in range(num): x = map(float, raw_input().split(' ')) if (x[0]-x[2])/(x[1]-x[3]) == (x[4]-x[6])/(x[5]-x[7]): print 'YES' else: print 'NO'
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s980758188
p00021
Runtime Error
num =input() for i in range(num): x = map(float, raw_input().split(' ')) if x[1]-x[3] == 0 or x[1]-x[3] == 0: if x[1]-x[3] == 0 and x[1]-x[3] == 0: print 'YES' elif: print 'NO' elif (x[0]-x[2])/(x[1]-x[3]) == (x[4]-x[6])/(x[5]-x[7]): print 'YES' else: print 'NO'
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s247290506
p00021
Runtime Error
num =input() for i in range(num): x = map(float, raw_input().split(' ')) if x[1]-x[3] == 0 or x[5]-x[7] == 0: if x[1]-x[3] == 0 and x[5]-x[7] == 0: print 'YES' elif: print 'NO' elif (x[0]-x[2])/(x[1]-x[3]) == (x[4]-x[6])/(x[5]-x[7]): print 'YES' else: print 'NO'
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s801819364
p00021
Runtime Error
n = input() for i in range(n): x1,y1,x2,y2,x3,y3,x4,y4 = map(float,raw_input().split()) if ((y2-y1)/(x2-x1) == (y4-y3)/(x4-x3)): print 'YES' else: print 'NO'
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s000390522
p00021
Runtime Error
ans = [] n = input() for i in range(n): x1,y1,x2,y2,x3,y3,x4,y4 = map(float,raw_input().split()) if ((y2-y1)/(x2-x1) == (y4-y3)/(x4-x3)): ans.append('YES') else: ans.append('NO') for i in ans: print i
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s595852901
p00021
Runtime Error
ans = [] n = input() for i in range(n): x1,y1,x2,y2,x3,y3,x4,y4 = map(float,raw_input().split()) if (x2-x1 ==0) or (y2-y1 == 0): if (x2-x1 ==0) and (y2-y1 == 0): ans.append('YES') else: ans.append('NO') if (x4-x3 ==0) or (y4-y3 == 0): if (x4-x3 ==0) and (y4-y3 == 0): ans.append('YES') else: ans.append('NO') elif ((y2-y1)/(x2-x1) == (y4-y3)/(x4-x3)): ans.append('YES') else: ans.append('NO') for i in ans: print i
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s618961984
p00021
Runtime Error
a = int(input()) for i in range(a): ans = map(float,raw_input().split()) if (ans[3]-ans[1])/(ans[2]-ans[0]) == (ans[7]-ans[5])/(ans[6]-ans[4]): print "YES" else: print "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s774463514
p00021
Runtime Error
for i in range(int(input())): x1, y1, x2, y2, x3, y3, x4, y4 = map(float,raw_input().split()) if (y2-y1)/(x2-x1) == (y4-y3)/(x4-x3): ans = (y2-y1)/(x2-x1) if y1-ans*x1 == y3-ans*x3: print "NO" else: print "YES" else: print "NO"
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s791443574
p00021
Runtime Error
#!/usr/bin/python import sys from collections import namedtuple from math import sqrt Point = namedtuple('Point', 'x y') def datasets(): raw_input() for line in sys.stdin: x1, y1, x2, y2, x3, y3, x4, y4 = [float(w) for w in line.strip().split()] p1 = Point(x1, y1) p2 = Point(x2, y2) p3 = Point(x3, y3) p4 = Point(x4, y4) yield p1, p2, p3, p4 def main(): for A, B, C, D in datasets(): a1 = (B.y - A.y) * -1 b1 = B.x - A.x a2 = (D.y - C.y) * -1 b2 = D.y - C.y if a1*b2 == a2*b1: print "YES" else: print "NO" if __name__ == '__main__': main()
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s817795904
p00021
Runtime Error
#!/usr/bin/python import sys from collections import namedtuple from math import sqrt Point = namedtuple('Point', 'x y') def datasets(): raw_input() s = sys.stdin.read() for line in s.splitlines(): x1, y1, x2, y2, x3, y3, x4, y4 = [float(w) for w in line.strip().split()] p1 = Point(x1, y1) p2 = Point(x2, y2) p3 = Point(x3, y3) p4 = Point(x4, y4) yield p1, p2, p3, p4 def main(): for A, B, C, D in datasets(): a1 = (B.y - A.y) * -1 b1 = B.x - A.x a2 = (D.y - C.y) * -1 b2 = D.y - C.y if a1*b2 == a2*b1: print "YES" else: print "NO" if __name__ == '__main__': main()
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>
s696726162
p00021
Runtime Error
#!/usr/bin/python import sys from collections import namedtuple from math import sqrt Point = namedtuple('Point', 'x y') def datasets(): sys.stdin.readline() s = sys.stdin.read() for line in s.splitlines(): x1, y1, x2, y2, x3, y3, x4, y4 = [float(w) for w in line.strip().split()] p1 = Point(x1, y1) p2 = Point(x2, y2) p3 = Point(x3, y3) p4 = Point(x4, y4) yield p1, p2, p3, p4 def main(): for A, B, C, D in datasets(): a1 = (B.y - A.y) * -1 b1 = B.x - A.x a2 = (D.y - C.y) * -1 b2 = D.y - C.y if a1*b2 == a2*b1: print "YES" else: print "NO" if __name__ == '__main__': main()
2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
YES NO
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Parallelism</H1> <p> There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>". </p> <H2>Input</H2> <p> Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/> <br/> $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/> </p> <p> You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$. Each value is a real number with at most 5 digits after the decimal point. </p> <H2>Output</H2> <p> For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line. </p> <H2>Sample Input</H2> <pre> 2 0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0 3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0 </pre> <H2>Output for the Sample Input</H2> <pre> YES NO </pre>