Programming contests

ECN programozó csapatverseny, 2022. május 28.

May 28, 2022 10:15 AM – May 28, 2022 3:15 PM

Graphs With a Special Labeling Property

In many distinct areas of mathematics, as a result of deep characterization theorems, surprisingly arrive — nobody knows exactly why — the same special graphs. A very simple instance in which these graphs also appear, is the next one.

Take a simple connected graph and label its vertices with positive integers in such a way that the double of each number minus 2 is equal to the sum of the neighbouring numbers. It turns out that such a labeling is never possible, except for a few very special graphs. These graphs are the members of two infinite family, having n vertices, named An (n ≥ 2) and Dn (n ≥ 4), shown below with the proper labeling, and surprisingly enough, three more singular graphs, having 6, 7, and 8 vertices respectively, named E6, E7, and E8, shown below without their labeling.

Your task is to compute the proper labeling of these last three graphs.

Input Specification

There is no input for this problem.

Output Specification

Output three lines, each containing an integer, the sum of the labels of E6, E7, and E8, respectively.

University of Debrecen; Faculty of Informatics; v. 03/01/2019