array_1 = [1, 5, 10, 20, 40, 80, 100] array_2 = [6, 7, 20, 80, 100] array_3 = [3, 4, 15, 20, 30, 70, 80, 120] # Задача 1 common_elements = [] for elem in array_1: if elem in array_2 and elem in array_3: common_elements.append(elem) print("Задача 1:") print("Решение без множеств:", common_elements) common_elements_set = set(array_1).intersection(set(array_2)).intersection(set(array_3)) print("Решение с множествами:", list(common_elements_set)) # Задача 2 unique_elements = [] for elem in array_1: if elem not in array_2 and elem not in array_3: unique_elements.append(elem) print("Задача 2:") print("Решение без множеств:", unique_elements) unique_elements_set = set(array_1) - set(array_2) - set(array_3) print("Решение с множествами:", list(unique_elements_set