Two triangles
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Two triangles ABC and DEF are given. Determine, are they similar.
Input
First line contains the coordinates of vertices for triangle ABC: x[A]
, y[A]
, x[B]
, y[B]
, x[C]
, y[C]
. Second line contains the coordinates of vertices for the second triangle in the same format. All numbers are integer and do not exceed 5000 by absolute value. Both triangles have nonzero area.
Output
Print YES if the triangles are similar and NO otherwise.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 1K
Acceptance rate 25%