#P2819. 图的 m 着色问题

图的 m 着色问题

Description

For a given undirected connected graph GG and mm different colors, write a program to compute all distinct colorings of the graph.

Input Format

The first line contains 33 positive integers n,k,mn, k, m, indicating that the given graph GG has nn vertices and kk edges, and there are mm colors. The vertices are labeled 1,2,,n1, 2, \dots, n. The next kk lines each contain 22 positive integers u,vu, v, representing an edge of the graph (u,v)(u, v).

Output Format

At the end of the program, output the number of computed distinct coloring schemes.

5 8 4
1 2
1 3
1 4
2 3
2 4
2 5
3 4
4 5
48

Hint

The data guarantees 1n1001 \leq n \leq 100, 1k25001 \leq k \leq 2500.

When nn is large, it is guaranteed that kk is sufficiently large.

It is guaranteed that the answer does not exceed 2000020000.

The testdata is randomly sampled from valid data that meet the above conditions.

Translated by ChatGPT 5