SP839 OPTM - Optimal Marks

Description

You are given an undirected graph G(V, E). Each vertex has a mark which is an integer from the range \[0..2 $ ^{31} $ – 1\]. Different vertexes may have the same mark. For an edge (u, v), we define Cost(u, v) = mark\[u\] xor mark\[v\]. Now we know the marks of some certain nodes. You have to determine the marks of other nodes so that the total cost of edges is as small as possible.

Input Format

N/A

Output Format

N/A