They were some of the most fiendish problems ever set for young mathematicians in an international competition. But toughness did not deter a team of British prodigies, who have just pulled off the country's proudest maths performance in more than a decade.
Three teenagers representing the UK have just returned from Romania, where they scooped top prize in an invitation tournament.
The Romanian Master in Mathematics contest was set up to complement the International Mathematical Olympiad, which began in 1959 and now includes more than 90 countries. The problems in the Romanian Master were harder, however, with only the strongest Olympiad contenders selected to take part. This included the reigning champions from Russia.
Each competitor had four problems to solve in what might seem like a generous five hours. But the exacting discipline of mathematical proof is not for the faint-hearted.
To the shock of their competitors, the British emerged victorious, taking 51 points out of a possible 84, two ahead of Russia and Serbia. This is our best performance in an international maths contest since placing fifth in the 1996 Olympiad, said the UK Mathematics Trust.
Dr Geoff Smith, chair of the British Mathematical Olympiad, said the win was an "unalloyed delight", coming after the UK underperformed in last year's Olympiad.
Of this month's triumph, he said: "When the team won, it was slack-jaw time for the Eastern Europeans. They were just expecting us to come and make up the numbers."
The win came despite the specialist tuition available in some of the competing countries.
Dr Smith said: "In countries such as Hungary, Romania and Bulgaria, they take the brightest kids at 10 or 11 and stick them in schools where they get special teaching.
"That, of course, is completely taboo in the UK, and other countries such as France and Germany, so this win is especially impressive."
The approach in this country is voluntary: Dr Smith leads an elite squad of 20 UK mathematicians, who are trained in their spare time.
Jonathan Lee, 17, from Loughborough Grammar in Leicestershire, was the UK's top performer, finishing third overall.
He scored maximum marks for two of the four problems, and six out of seven for a third. He also featured in Beautiful Young Minds, a BBC documentary last year about gifted young mathematicians.
Jonathan, who designs rockets in his spare time and holds a UK record for the height achieved by one of them, gained a gold medal for his latest maths achievement.
"I was pleased, certainly," he said. "We did better than I think we had expected."
His teammates, Tim Hennock, of Christ's Hospital School in Horsham, West Sussex, and Dominic Yeo, of St Paul's School in Barnes, south-west London, gained silver and bronze medals.
PIT YOUR WITS AGAINST A BEAUTIFUL MIND
Jonathan Lee, 17, earned full marks for this problem at the Romanian Master in Mathematics contest:
Consider a square of side length a positive integer n. Suppose that there are (n+1)2 points in the interior (ie strictly inside) of the square. Show that three of these points define a possibly degenerate triangle of area at most half. (A triangle is degenerate if its vertices are collinear.)
Jonathan's answer to this problem can be viewed at www.tes.co.uk2579686.