Oct 18, 2023
This problem might seem difficult at the first glance, since connect an edge from every customer to every stand results in \( knm\ge 10^8 \) edges.
Instead, consider adding some helper nodes \( s_{i, j, a, b} \) indicating the whole stand range from \( (i, j) \) to \( (i+2^a, j+2^b) \).
Try to show that the graph is bipartite.
Let us start from the middle point. We then need to find two non-intersecting paths to the start and the end.