Problem

Source: Croatian TST 2015

Tags: combinatorics, TST, graph theory, Croatia, paths



There are $N$ cities in a country, some of which are connected by two-way flights. No city is directly connected with every other city. For each pair $(A, B)$ of cities there is exactly one route using at most two flights between them. Prove that $N - 1$ is a square of an integer.