Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- point = ['1 0 0 0', '1 0 0 1', '1 0 0 2', '0 1 0 0', '0 1 0 1', '0 1 0 2', '0 0 1 0', '0 0 1 1', '0 0 1 2', ]
- ans = []
- arr = [[] for i in range(9)]
- n = int(input())
- for i in range(9):
- print(point[i])
- for j in range(n):
- s = input()
- if s == 'parallel':
- arr[i].append(s)
- else:
- arr[i].append([float(i) for i in s.split()])
- for o in range(3):
- for i in arr[o * 3]:
- if i[0] == 'p':
- continue
- for j in arr[o * 3 + 1]:
- if j[0] == 'p':
- continue
- for k in arr[o * 3 + 2]:
- if k[0] == 'p':
- continue
- a = (j[0] - i[0]) / (k[0] - j[0])
- b = (j[1] - i[1]) / (k[1] - j[1])
- c = (j[2] - i[2]) / (k[2] - j[2])
- if a == b and b == c:
- for l in ans:
- a = (j[0] - l[0][0]) / (k[0] - j[0])
- b = (j[1] - l[0][1]) / (k[1] - j[1])
- c = (j[2] - l[0][2]) / (k[2] - j[2])
- if a == b and b == c:
- a = (j[0] - l[1][0]) / (k[0] - j[0])
- b = (j[1] - l[1][1]) / (k[1] - j[1])
- c = (j[2] - l[1][2]) / (k[2] - j[2])
- if a == b and b == c:
- break
- else:
- ans.append([[j[0], j[1], j[2]], [k[0], k[1], k[2]]])
- print('answer:')
- for i in ans:
- print(i[0][0], i[0][1], i[0][2], i[1][0], i[1][1], i[1][2])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement