The jury has a great artistic idea — to create a rectangular panel out of a huge pile of black and white squares of the same size. The panel should have exactly $b$ 4-connected areas made of black tiles, and $w$ 4-connected areas made of white tiles.
Remember, a 4-connected area of some color is a maximal set of the panel tiles such that:
- any two tiles of the area share the same color;
- for any two tiles of the area there is a tile sequence connecting them, such that any two consecutive tiles of the sequence share a common side.
In addition to the artistic idea, the jury has already developed a program that produces design of the panel. But since this problem is about art, any new solution is extremely important for the jury.