Maxflow GCD Coloring

Left input: graph definition. Right input: coloring (optional). Follow the input and output format of the problem.

n, m: 1..20; capacities 1..1000.
Note: input validation is not strict.
Colored vertices and edges denote the induced subgraphs.
Drag vertices for better placement.