#실습 1
import random
L1 = []
for i in range(10):
x = random.randint(1, 100)
L1.append(x)
ma = 1
L2 = [0, 0]
for i in range(0,9):
for j in range(i+1,9):
if ((L1[i] + L1[j]) > ma):
L2.pop(0)
L2.pop(0)
ma = L1[i] + L1[j]
L2.append(L1[i])
L2.append(L1[j])
#print(L1)
if((L2[0] % 2 == 0 and L2[1] % 2 == 0) or (L2[0] % 2 != 0 and L2[1] % 2 != 0)):
print("NONE")
else:
print(L2)
print(L2[0] + L2[1])
#실습 2
points = [(0, 0), (-1, -1), (4, 2), (2, -3), (6, 7), (8, 4), (12, -2)]
def is_linear(p1, p2, p3):
x1, y1 = p1
x2, y2 = p2
x3, y3 = p3
return (y2 - y1) * (x3 - x2) == (y3 - y2) * (x2 - x1)
n = len(points)
for i in range(n):
for j in range(i + 1, n):
for k in range(j + 1, n):
if is_linear(points[i], points[j], points[k]):
print(points[i], points[j], points[k])
'''
#이론 1
1. x
2. x
3. o
#이론 2
1. x
2. o
2. o