[BOJ 10640] Rings

View as PDF

Submit solution

Points: 3
Time limit: 3.0s
Memory limit: 128M

Problem types
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

There are two circles with radius 1 in 3D space. Please check two circles are connected as chained rings.</p>

 

입력 형식

The input is formatted as follows.</p>

pe

First line contains three real numbers(−3 ≤ cxi, cyi, czi ≤ 3). It shows a circle's center position. Second line contains six real numbers (−1 ≤ vxi,j ,vyi,j, vzi,j ≤1). A unit vector (vx1,1, vy1,1, vz1,1) is directed to the circumference of the circle from center of the circle. The other unit vector (vx1,2, vy1,2, vz1,2) is also directed to the circumference of the circle from center of the circle. These two vectors are orthogonalized. Third and fourth lines show the other circle information in the same way of first and second lines. There are no cases that two circles touch.

출력 형식

If two circles are connected as chained rings, you should print "YES". The other case, you should print "NO". (quotes for clarity)</p>

 

예제 입력 1

0.0 0.0 0.0
1.0 0.0 0.0 0.0 1.0 0.0
1.0 0.0 0.5
1.0 0.0 0.0 0.0 0.0 1.0

예제 출력 1

YES

예제 입력 2

0.0 0.0 0.0
1.0 0.0 0.0 0.0 1.0 0.0
0.0 3.0 0.0
0.0 1.0 0.0 -1.0 0.0 0.0

예제 출력 2

NO

예제 입력 3

1.2 2.3 -0.5
1.0 0.0 0.0 0.0 1.0 0.0
1.1 2.3 -0.4
1.0 0.0 0.0 0.0 0.70710678 0.70710678

예제 출력 3

YES

예제 입력 4

1.2 2.3 -0.5
1.0 0.0 0.0 0.0 1.0 0.0
1.1 2.7 -0.1
1.0 0.0 0.0 0.0 0.70710678 0.70710678

예제 출력 4

NO

Comments

There are no comments at the moment.