https://vjudge.net/problem/UVA-1603
题目
The left figure below shows a complete \times 3$grid made with2$ \times(3 \times 4)$(=24) matchsticks. The lengthsof all matchsticks are one. You can find many squares of different sizes in the grid. The size of a squareis the length of its side. In the grid shown in the left figure, there are 9 squares of size one, 4 squaresof size two, and 1 square of size three.Each matchstick of the complete grid is identified with a unique number which is assigned from leftto right and from top to bottom as shown in the left figure. If you take some matchsticks out from thecomplete grid, then some squares in the grid will be destroyed, which results in an incomplete \times 3$ grid. The right figure illustrates an incomplete \times 3$ grid after removing three matchsticks numberedwith 12, 17 and 23. This removal destroys 5 squares of size one, 3 squares of size two, and 1 square of size three. Consequently, the incomplete grid does not have squares of size three, but still has 4 squaresof size one and 1 square of size two.The l