#P10738. [SEERC 2020] 3-colorings

[SEERC 2020] 3-colorings

Problem Description

This is an output-only problem.

A valid “3-coloring” of a graph is defined as follows:

  • The color of each vertex can only be in {1,2,3}\{1,2,3\}.

  • For every pair of adjacent vertices (u,v)(u,v), the color of uu must be different from the color of vv.

It can be proven that the maximum number of “3-colorings” of a graph is 3n3^n.

Now you need to construct a graph. Initially, it has n (1n19)n \ (1 \leq n \leq 19) vertices and m (1mn(n1)2)m \ (1 \leq m \leq \frac{n(n-1)}{2}) undirected edges. Then, for each kk with 1k5001 \leq k \leq 500, you may add at most 1717 undirected edges so that the number of “3-colorings” of the graph becomes 6k6k.

Input Format

None.

Output Format

The first line contains n,mn,m, representing the number of vertices and edges in the graph you construct.

Then output mm lines, each with two integers u,vu,v, indicating that there is an undirected edge (u,v)(u,v).

Then for kk from 11 to 500500, for each kk output the number of edges you want to add, followed by that many lines of added edges (u,v)(u,v).


3 2
1 2
2 3
1
1 3
0

Hint

The sample only provides examples for k=1k=1 and k=2k=2.

Translated by ChatGPT 5