RU
Имеется список 40 студентов, изучающих математику, физику, биологию и химию, заданный в файле в виде строк "Фамилия - Предмет".
Каждый предмет изучает около 20 студентов. Разработать структуры данных, позволяющих эффективно отвечать на запросы вида «Выдать всех студентов, изучающих биологию и химию, но не изучающих физику».
EN
There is a list of 40 students studying mathematics, physics, biology and chemistry, specified in a file in the form of the lines "Last name - Subject".
Each subject is studied by about 20 students. Develop data structures that allow you to efficiently answer queries like “Identify all students studying biology and chemistry, but not studying physics.”