You have to build a maze whose exit can be changed by a computer. The maze consists of one entrance, hallways which can intersect, and $n$ exits.
The computer has several wires leaving it each controlling a set of gates, which are located in the hallways. All the gates controlled by the same wire must either be all open or all closed at the same time.
In what way should this maze be built so that the number of wires leaving the computer is the lowest possible, while being able to pick any exit?
Clarification: There cannot be more than one exit open at the same time.