Problem G : Pipes
Problem B: Pipes
![](http://uva.onlinejudge.org/external/117/p11700.jpg)
The game is played on a grid with R rows and C columns. Each square of the grid contains a black dot in the centre and black lines in the direction of some, none, or all of its north, east, south, and west neighbouring squares, with the following restriction: if two opposite directions both have lines, then at least one of the other two directions has a line as well. In other words, it is forbidden