Advertisement
Guest User

Untitled

a guest
Jan 26th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. 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', ]
  2. ans = []
  3. arr = [[] for i in range(9)]
  4. n = int(input())
  5. for i in range(9):
  6. print(point[i])
  7. for j in range(n):
  8. s = input()
  9. if s == 'parallel':
  10. arr[i].append(s)
  11. else:
  12. arr[i].append([float(i) for i in s.split()])
  13. for o in range(3):
  14. for i in arr[o * 3]:
  15. if i[0] == 'p':
  16. continue
  17. for j in arr[o * 3 + 1]:
  18. if j[0] == 'p':
  19. continue
  20. for k in arr[o * 3 + 2]:
  21. if k[0] == 'p':
  22. continue
  23. a = (j[0] - i[0]) / (k[0] - j[0])
  24. b = (j[1] - i[1]) / (k[1] - j[1])
  25. c = (j[2] - i[2]) / (k[2] - j[2])
  26. if a == b and b == c:
  27. for l in ans:
  28. a = (j[0] - l[0][0]) / (k[0] - j[0])
  29. b = (j[1] - l[0][1]) / (k[1] - j[1])
  30. c = (j[2] - l[0][2]) / (k[2] - j[2])
  31. if a == b and b == c:
  32. a = (j[0] - l[1][0]) / (k[0] - j[0])
  33. b = (j[1] - l[1][1]) / (k[1] - j[1])
  34. c = (j[2] - l[1][2]) / (k[2] - j[2])
  35. if a == b and b == c:
  36. break
  37. else:
  38. ans.append([[j[0], j[1], j[2]], [k[0], k[1], k[2]]])
  39. print('answer:')
  40. for i in ans:
  41. 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