Centuries-old exam selected people for some of the most powerful positions in the country; was just as difficult as today's ...