The United States last week ended a 21-year drought when its team took home first place in the annual International Mathematical Olympiad. The U.S. win broke a long stretch dominated by China, which placed lower than second only once during that period (China took second this year). China has been participating since only 1985, which makes its record all the more impressive: It has won almost two-thirds of the Olympiads it has competed in.

The International Mathematical Olympiad (IMO) is a competition for high schoolers around the world. The U.S. ranks 36 of 65 countries and economies on math proficiency among 15-year-olds, according to the 2012 Programme for International Student Assessment, but those rankings are based on populationwide statistics; the IMO pits countries’ very top tier against one another. The U.S. picks its six-person team through a series of tests. These aren’t the standardized tests students take at the end of the year. U.S. students take three tests: the AMC (multiple choice), the AIME (all answers are integers between 0 and 999) and the USAMO (six questions, all proof-based). Any student in eighth through 12th grade can choose to take the AMC, but to take any subsequent tests, students must score high on the preceding one. The students who do best on the USAMO are invited to a summer camp for training, and the final squad is chosen from among the attendees.

More and more countries are participating in the IMO — 104 this year — but top places are dominated by a small number of countries. While formerly competitive countries such as Hungary and Romania have fallen behind, China, Russia and the U.S. have held the top three slots in a third of the competitions since the dissolution of the Soviet Union.

Although the U.S. had been mostly shut out from the top prize, the Americans have put up incredible individual results. The IMO awards gold medals to contestants whose scores place them in approximately the top 8 percent of competitors. Since the U.S. began competing in 1974, it has won 109 gold medals, putting it in second place overall. The U.S. ties the USSR for the third-highest rate of gold medals won per competition participated in (2.7 medals), behind China (4.6) and Russia (3.6).

If you want to play along at home, here’s one of the six questions from this year’s competition:

Determine all triples (a, b, c) of positive integers such that each of the numbers: ab-c, bc-a, ca-b is a power of two.

Like Fermat’s Last Theorem, this problem is easy to describe and hard to solve. Only 5 percent of the competitors got full marks on this question, and nearly half (44 percent) got no points at all.

But, on the triumphant U.S. squad, four of the six team members nailed it.