How a minority of voters select a majority of legislators