利用C语言来解决类似迷宫的问题,下面例子分别用两种方法来解决!
[Problem]
There is a maze as shown in the diagram below. In the maze in the form of a 100*100 matrix, the white background represents the road while the yellow background represents the wall.
Assuming the upper left corner block to be (0, 0), the horizontal direction to be x direction and vertical direction to be y direction, the starting point of the maze is (1. 1) and the arriving point is (13, 13).
Create a program to determine if there is a path to reach the arriving point from the starting point.
In the following example, there is the path.
In the following example, the starting point is (1, 1) and the arriving point is (11, 11). Thus, there is no route.
It should be noted that the above example uses 16x16 instead of 100x100 because of the space limitation.
[Input]
The first line of the input file provides the test case number. The test cases are followed in next lines.
Total of 10 test cases are given.
In each test case, 1 refers to the wall, 0 refers to the road, 2 refers to the starting point and 3 refers to the arriving point.
[Output]
The output file outputs the test case number following the ‘#’ symbol. It is followed by a space, 0 or 1 to indicate whether the arriving point can be reached (1 - yes, 0 – no).
[Input Example]
1 111111111111111111111111111111111111111111111111111111111111111111111111111111... 121000000010000000000000000000000000000000100010001000000000000010000010000000... 101011111011101110111111111111111111111110101011101011111110111010111010101110... 100010001010001000100000000010000000000010001010001000101000101010001010101000... 111110101010111111101111111011101110111111111010111110101011101010101110101111... 100000101010001000001000001000101010000010000010100010101000100010100000100010... ... 2 111111111111111111111111111111111111111111111111111111111111111111111111111111... 121000000010000000100010000000000010000010001000100000101000000000000010000000... 101110111011111010101010111111111011101010101010101110101011111011111010111110... 100010101000000010001010001000001000001010100010001010100000001000100010001000... 111010101111111111111010101011101111111010111111111010111011111110111111101011... 101000100000100000001010100010100000100010100000100010001010000000100000001010... 101111101110101011111010111110111110101110101110101011101010111110101111111010... ... |
[Output Example]
#1 1 #2 1 ... |
PS:maze2_test_input.txt
1 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1210000000100000000000000000000000000000001000100010000000000000100000100000001000000010001000000011 1010111110111011101111111111111111111111101010111010111111101110101110101011101111101010101011111011 1000100010100010001000000000100000000000100010100010001010001010100010101010000010001000100010001011 1111101010101111111011111110111011101111111110101111101010111010101011101011111010111111111110111011 1000001010100010000010000010001010100000100000101000101010001000101000001000100010000000000010000011 1011111010111010111110111011101010111110101111101010101011101011101111111110101110111111111010111111 1010001010001010001000100000101010000010100000101010100010001000101000100010101000000000001010100011 1010101111101011101110111111101010111010111110101010111010111110111010101010101111111011111010111011 1010100010001000100000100000001010100010001000100010000010001000100010001000100000001010000010100011 1010111010111011111011101111111010101111101011111111111111101011101111101111111111101110111110101111 1010001000100000000010001000001000100010001000000010000010001000001000001000000000100000100010100011 1011101111111111111110111011101111111010111111111010111010111110111111111011111110111111101110111011 1000100010000000000000101000100000001010100000001010101000101000100000000010000010100000000010000011 1110111010111111111111101110111011111010101110111010101111101011101111111110111010111011111011111011 1000001010001000100010001000101000000010001010000010100010000010001000001000001010001010100010001011 1011101010101010101010101011101111111111111011111110111010111110111010111011101111101010101010101011 1000101010101010001010100010000000000000000010000000001010100000100010000010101000001000101010101011 1010101011101011111010111111111110111111111010111111101010101111111111101110101011111011101011101011 1010101000101010001010000000000010100010001000100000101010100000001000100010101010000010001000001011 1010111110101010111011111111111011101010101011111011101010111111101010111010101011101110111011111011 1010100010101010001000000000001000101000101000000010001000100000100010001000101000101000100010001011 1010101010101011101110111011111110101111101110111110111110111011111111101011101110101010111110101011 1010101010001000001010001010000010001000101010100010000010001000000000101010001010101010100000100011 1010101011111111101011101010111011111011101010101011111011101111111110101110101010111011101111101111 1010001000100010001000101010001010000010001010101000000010100000001000100000101010001000001000100011 1011111011101010111011101011101010111010111010101111111110111111101010111111101011101011111010111111 1010100010001010100000101010001000101000100010101010000000000000101010000000100000101010000010000011 1010101010111010111110101110111111101111101110101010111111111010101011111110111110101110111111111011 1000101010101000000000101000100010000000100000101000001000000010100010000010000010100010000010100011 1110101110101111111111101011101010101110101111101111111011111111111010111011111110111011111010101111 1010101000000000100000001000001010101000100000100000001000000000100010001000000010001000001000100011 1010101011111111101111111111111011101011111110111111101111111010101111101111111011101111101110111011 1000100010001000100010000000100010001000000010001000100000001010000000101010000010001000100010001011 1011111110101010111010111011101110111111111011101010111111101111111111101010111110111110101111101011 1000100000100010000010001010001000100000001010001010000010001000000010001010000000000000100000101011 1110101111111111111011101010111110101111111010111111101010111011111010111011111111111110111110101011 1000100010001000101000101010100000100000001010100000101010001000001010100000000000100010000010001011 1011111010101010101110101010101111111111101010111010101011101011111010101111111111101011111011111011 1000101010101010000010101010001000000000001010001010001000100010001000001000001000001010100010001011 1110101010101011111110101011111110101111111011101011111110111110101111101011101011111010101111101011 1010001000101000100000101000000010101000000010001010001000000010101000101010101000101010000000001011 1010111111101110101111101110111010111011111110111010101111111110101010111010101010101011101111111011 1000100000101000101000101010001000100010000010000010100010000000101010000010001010100000101000000011 1111101110101011101110101011101110101111101011101110111010111111101011111110111010111110111011111011 1000101000001000000000101000100010100000001010001000101010001000101000100010101010000010100010001011 1010101111111011111011101010111010111111111010111011101011101011101110111010101011111010101110111011 1010001000001010001010001010001010101000000010001010000010001000100000100010100010001010001000100011 1011111011101110101010111010101010101011111111111010111110111010111111101110101111101011111110101111 1010000010001000101010001010101010101000100000100010100000101010000000001000100000101000100000101011 1010111110101011101011101110101010101110101110101110101110101011111011101011111110101110111011101011 1010101000101010001000100000101010001000101000101000100010101000101010001010000000000010001000001011 1010101011111010111111111110111011111011101011101011111010101110101011111011111111111011101011111011 1010101000001010000000000010100010000010001010001010001010100000001000000010000010001000101000100011 1010101111101011111111101010101110111111101011101010101010111111111110111110111010101110101110101011 1010100000101000101000001010100000101000001000001000101010000000000010000000101010101000101010101011 1010111110101110101011111110111111101010111111111111101111111111111011111111101010101011101010101111 1000100010101000001000100010000000100010001000001000100000001000000010001000001010100010101010100011 1011101010101011111110101011111110111111101011111010111111101011111110111011101010111110101010111011 1000001000100000100000101000000010000010001000000010000000101000100000100000101010100000101000100011 1111111011111110101011101111111011111010111011111111101111101010111110101111101010101111101011101011 1010000010001000101010001000100010001000101000100010100010001010100010001000001010001000001000101011 1010111110101111101010111110101010111111101110101010111010111010101010111011111011101011111110101011 1000001000100000001010000000101010000000000010101010001010100010001010001000000010001010000010001011 1011111011101111111111101111101011101110111110101010111010111011111011111110111110111010111011111011 1010001010001000001000001000001000101000100010101000100010001010001000000010001000101010001000100011 1110101011111011101011111011111110101011101010101110101111101110101111111011101110101011111010101111 1000101000000010100010001010000000001000101010100010100000100010100000001000100010101000001010100011 1011101011111110111111101010111111111111101010101011111011111010111111101110111010101111101010111011 1010001010000000000000001010001000000010001000101000001010000010000010000010100010001000101010100011 1010111011111011111111101011101011111010111111101110111010111110111011111010101111101010101011101111 1010001000100010000000001010001010000010100000001000100010100010001000001000101000001010001000101011 1011101110101110111111111011111010111110111111111010101110101011101111101111101111101011111110101011 1010000010001000100000001010000010000000100010000010100000101000100010001000001000101000100010101011 1011111011111011101111101010111111111111101010111111111111101011101110111011111010101110101010101011 1000001000001000101000101010100000100000001000100000000010001000001000101010000010100010001010101011 1011101111101110101110101010111011101111101011101111101011111011111011101010111110111111111010101011 1010001000101000101000100010001000000000101010001000101000001000001010001000101000100000000010001011 1110111011101011101010111011101111111110101110111110101111101111111011101111101011101111111110111011 1000100010001000101010001000100000100010101000100000101000100000001000100000000010001000001000100011 1011111010111111101010111110111110101110101011101111101010111111101110101111111111101110101011101011 1000100010100000101010100000000010101000101000001000001010100000001000100010000000001000101000001011 1110101110101110101011101111111110101011101111101011111110101111111011111011101111111011111111111011 1000100000100010001000100000100000100010100000101000000010101000000000101010001000000000100010000011 1011101111101011111010111011101111111010111011101111111010101110111110101010111011111010101010111111 1010100010001010001010000010001000001000001000000000001010100010100000101010001010001010001010100011 1010111011111010101111111110111110101111111111111111111010111011101111101011101010101011111010101011 1010000010001010100000000010000000100000000010000000000010000010001000001000101010101000100010101011 1010111110101010111111111011111111111111111010111111111110111110111010111110101010101111101010111011 1010000000100010100000001000000000100000001010101000000000100000100010000010101010100000001010100011 1011111011111010101110111110111111101111101010101011111111111010111011101110101010111111111010101011 1000100010001010101010100010000000101000101010101000100000001010001010100010101010100000101010001011 1110111110101110101010101011111110101010101010101110101111101111101010111010101010101110101011111011 1000100000101000100010001000000010001010101000100010100010000000101000100010001010001010100010000011 1011101111101011111111111011111011111110101111101010101011111110101111101111111011111010111010111111 1010001000100010000010001000100000100010100000101000101000100000100000100000001000001010001010001311 1010111110111110111010101111101110101010111110101111111110101111111110101011111111101011101111101011 1000000000000000100000100000001000001000000010000000000000100000000000101000000000000000100000000011 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 2 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1210000000100000001000100000000000100000100010001000001010000000000000100000000000001000001000000011 1011101110111110101010101111111110111010101010101011101010111110111110101111101111101110101111111011 1000101010000000100010100010000010000010101000100010101000000010001000100010001000100000100000001011 1110101011111111111110101010111011111110101111111110101110111111101111111010111110111111111111101011 1010001000001000000010101000101000001000101000001000100010100000001000000010100010000000000000100011 1011111011101010111110101111101111101011101011101010111010101111101011111110101011111110111111111011 1000000000101010001000100010000010001000001000101010101010101000101010000010001010000010000000001011 1111111110101111101011111011111010101111111110101010101011101110101010111011111010111010111111101011 1000001000101000101000001010000010101000100000101010001000100010001010001000001010100010001010001011 1011101011101010101111101010111010111010111011101011101110101010111011111111101010101111101010111011 1000101010001010100010001010001010000010001000101010001000101010001010000000001000100000100010001011 1010101011101010101010111010101011111111101110101010111011111011111010101111111111111110111111101011 1010101000100010101010100010101000100000100010100010100010000010000010101000000010000010000000100011 1010101110111110111010101111101110101110111010111111101110111110111110111011101110101011111110111111 1010100010001010001010100000001000101000001010001000000000100010001000100010100000101000000010000011 1010111010101011101010111111111011101111101010101011111111101011101010101110111111101011111111111011 1010100010101000101010001000100010100010000010101000001000001000001010000000001000101010000000100011 1010101111101110101011101010101110111011111110101011111011111111111011111111101010101010111110101111 1010101000001000101000100010100000101000000010100010001010001000001010000000101010001010100010100011 1110101110111011101010111110111110101111111011111110101010101110111010111110111011111110101010111011 1000101000101000001010101000100010000000100010000010101010100010001010100000100010001000101000100011 1011101011101011111010101011101011101111101110111010101010111010101010111011101110101010111110101011 1010000010000010000010001010001010001000100000100010101010001010100010001010001000100010100010001011 1011111110111111111011101010111010111010111111101110101011101011111111101011101011111110101011111011 1000001000100010001010001010001010100010000000100000101000001000000010001010001000001000101000001011 1011101110101010101010111011101011101111111110101111101111111111111010111010111111101011101111101011 1010100010101010100010001010001010001000100010100010100000001000001000100000100000001000101000101011 1010111010101010111110111010111010111011101010111010111111101011101110111111101111111110101010101111 1010100010001010001010100010101000100000001010101000100010100000100000100010001000000010101010100011 1010101111111011101010101110101111101111111010101110101010111111111111101010111010111110101011111011 1010100010001000001000100000100000000010001010100000101000000010001000101000101010000000100010000011 1010111010101011111111111111111011111110101010111011101111101110101010101111101011111111111010111011 1000001010101010000000001000001000001000100010001000101000001000100010001000000000001000000010100011 1111101011101010111111101010101111101011111111101110101011111010111111111011111111111011111010111111 1000101000100010101000001010101000001010000000101000001010001010100010000000000010000010001010000011 1010101110101110101010111010101111101010111110101011111110101011101011111111111110111110101111111011 1010001000100010101010100010101000101010100010101010100000101000101010000010000000001000100010001011 1111111011101110101011101110101010101010111010101010101111101110101010111010111111111011111010101011 1000000010101000101000001010101010101010100010001000101000100010001010001000001000001010000010100011 1011111110101011101111111010101010111010101111111011101011111011111011101111111011101010111110111111 1010001000101010000000100010100010001010100000100010001010001000001000000000100010100010000010100011 1010101110101010111110101010111111101010111011101110111010101111101111111110101110111111111010101011 1010100010001000101000101010000000100010001010000010100000100000100000001000100010000000001010001011 1010111010111111101011111011111110101111101010111110101111111110111111101111111011111011101011111011 1010101010101000001010001000100000101000001010100010100010001010000000100000001000001000101000100011 1010101010101011101010101110101011111011111010101010111010101011111110111111101111101110101110101011 1010101010001000100010100010101010001000101000101000101000101000000010100000100000001000101000101011 1010101011111110111110111010101110101110101011101111101111101010111110101011111111111011111011101111 1010101000001000100000101010100000100010100010001000100000101010000010101000000000100000001010000011 1010101111101011101110101010111111101010111010111011101011101111111010101111111010101111101011111011 1000100010001010101000100010001000001010001010001000001000100010000010001000101010101000101000001011 1011111010111010101011101110101011111111101111101110111110111010111011111010101011101110101111101011 1010001010000010001010000000101000001000101000100010100010001000100010000010101010001000100000100011 1010101011111111111010111111101111101010101010111010101011101111101110111110101010111010111110111011 1010101000001000000010100000100010100010101010000010101000001000101000000010001010100010101000100011 1010101011101110111110101110111010111110101011111111101111101010101011111011111010101110101011101111 1000100010100010100000101010101000100000100010000010001000101010001000001000001010101000001010001011 1111111110111010111111101010101110101110111111101010111011101011111011111011101010101111101010111011 1010000000100010100000100010101000101010100000101010100000001010000010001010001010100000101000100011 1010111010101110101110111010101011101010111010101010111111101010111110101010101010101110111111111011 1000100010100010000010000010101000101000100010001010000000101010001000101010101000100010000000000011 1111101110111011111011111110101011101011101111111011101110111011101011101010111111111011101111111011 1000001000100010001000100010100010001000001000001000101000100010101010001010000010000000101000000011 1010111111101110101111101010101110111111111011111110111011101110101010111111101011111110101111111111 1010100000101000100010001000101010000000001000000000100010001000001010100000101000000010100000000011 1011101110101011111010111111101011111111101011111111101010111110111010101110101111111011111011111011 1010001000100010001010001000100000000010001000001000001010000010001010001010100010001000001010001011 1010111011111110111011101011101111111110111111101011101111111011101011111010101010111111101110101011 1010001000000010000010001010001000001000100010101010100000001000101000101000101010100000100000100011 1010111111101010111110111010111011101011101010101010111110111110101110101011101010101011111111111011 1010100000101000000000100000001010001010001010101000001000100000100010101000101010001000000000101011 1010101110111111111111111110111010111010111010101111111010101111111110101110111010111111101110101011 1000101010001000000000100010100010001010001010001000001010100010000000100010000010000010100010001011 1111101011101011111110101011101111101010111010111011101011111010111111101011111111111010111011101011 1000101010000010000000001000001000000010100010001010001000001000100000001000001000001010001010001011 1010101010111111111011111111111011111110101111101010111010111111101110111111101011101010111011101011 1010001000100000001010001000000000100010101000100010101010000000100010100000101010001010001000101011 1011101111101111101110101011111111101010101011111110101011111011101110101110101110101011101110101011 1000101000001010001000101000101000101000101000100000100000100010001000101000101000101000001010101011 1010111011111010111011101110101010101111101010101111101111101010111011101011101011101111101010111011 1010000010000010100010101000001010001010001010001000000010001010001010001010001010001000101010001011 1011111111101110101110101111111011111010111011111011111110101111101011101010111010111010101011101011 1010000010001000100010100000001000001010001010000010000010101000001010001010000010100010001010001011 1011101010111011111010111111101111101011101011111110111010101011111010111111111110101111111010111011 1010001000100010000010001010000000101000101000000010100000101010001010000000001000100000100010000011 1010111110101110111110101010111110101010101111111010101111111011101011111111101011111110111011111111 1010100010100000000000100010101000100010100010000010101000000010001000100000100000100010001000001011 1010101010111111111110111110101011101111111010111110101011111110111110101110111110101111101010101011 1000101010001000001000100000101000101000000010000000101010000010001000101010000010001000001010101011 1111101011111011101111101111101110101011111110111111111011101011101011101011111011111011111110101011 1000001000000010000000100010001000101000000010100000001000001000001000101000001000001000100000100011 1011111111111111111110111010101011101111111010101111101111111111101110101111101111101110101111111111 1010000000000000100000000010100000101000001010100000100000001010001010101000001000100010100000000011 1010111111111110111111111111101111101011111010111110111110101010111010101011101110111010111111111011 1010100000001000100000000000101000001000100010100010101000100010001010001010100000100010001000100011 1010111111101011101111111110111011111110101111101010101011111111101011111010111110101111101010101011 1000000000001000000000000010000000000000100000001000001000000000000000000010000000100000000010001311 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 3 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1210001000000000100000000000000000000010001000100000000000100000000000000010000000000000001000000011 1010111011111011101111101111111111111010111010101111111010111111111010111110111111101111101011111011 1010000000001010000000101000000000101010000010001000100010000000001010100010001000001000101000001011 1011101111111010111110101111111010101011111011111010101011111111101011101010111011111011101111101011 1000100010001000100010101000000010001000001000000010101010001010001000001000100010000000100000001011 1110101110101011101011101011111111101111101111111110101110101010111011111111101110111110111111111011 1010101000101000101000001010001010001000001000001000100000101010001000001000100010100000100000000011 1010101011101110101111111010101010111011111011101011111111101011101111111010111011101111101111111111 1010101010100010100010001000101000001000100010001000100000101000000000001010001000100000000010000011 1010101010111011101011101011101011111110101111111110101110101111111111101011101110101111101110111011 1000101010001000101000101000101010000000100000100010101000100000101000101010001000101000101000100011 1011111010101110111110101110101110111111111110101010101110111010101010101010111011101010111011101011 1000000010100010000000100010100010000010000010101000100010001010100010000010000010001010000010101011 1111111110111111111111101110111011111010101010101111111011101110111111111111111110111011111110101111 1000000010100000001010001000100000100010101010000010000010100010100000000010000000001000000010100011 1110111010101011101010101011101111101110101011111110111110111010101111111011111111111111111010111011 1000101010001010001010100000100000101000101000001000100010001010101000001000100010001000001000001011 1011101010111010111010111111111110101111101111101011101011101010101010111110101010101010111110111011 1010001010100010000010001000000000100000101000100010001000100000101010000010001010100010000000100011 1010111010101011111111101011111011111110101011111010111110111111101111101011111010111111111011101011 1010001010101010000000001000101010000010101010000010100000100000001000001010100010000010001000101011 1011101011101110111111111110101010101110101010111110101011101111111011111010101111111010101111101011 1010001000101000100010000010101010101000101010001000101010001000000010100010100000000010100000001011 1010111110101011101010111010101010101011101011101011101110111011111110101110111111111110111111111111 1010000010001000001010001000100010101010001000001010101000100010000010001000000010000010001000100011 1010101111101111111011101111101110101010101111111010101011101011111010111110111010111011101010101011 1010100000101000000010101000000010100010100010000010100010001000001000000010001010001000101010001011 1011111010101011111110101110111110111111111010111110111111111111101111111011101111101110101011111011 1010001010101000001000100010101000100000000010001000000000000000100010001000001000101000101010001011 1010101110101111101011111010101011101111111111101011111111111110101010101110111010101011101010101011 1000101000100010100010000010101010001000100000100010001000000010101010100000100010001000100010101011 1011101011111010111010111110101010111010101110111110101010111010111011111011101111111110111110101011 1000101000000000100010000010001010001010001000001000101010101010001000001010001000000010000000100011 1011101111111111101111111011111010101011111011101110111010101011101111101010111110111011101111111011 1010001000000000101000101000100010100010001010100000100010100010001000001010100010001000001000001011 1010111011111110101010101110101110111110101010111011101110111010111011111010101011101111111011101011 1010000000100000100010100010100010100010101010001010001010001010100010000010001000100000001000101011 1011111111101111111110101010111011101010101010111010111011101010111010111111111110111111111011101011 1010000000001000000010001010000010001000100010000010100010001010100010001000000010000000100010001011 1110111111101011111011111011111110111111111110111110111010101110101111101110101111111110101110111011 1000100000001000001000000010000000100000000010100000100010101000101000100010100000000010001010100011 1011101111111111101111111110111110101011111110101111101010101011101010111010111111111011111010101111 1000100010001000100000000010101000101010000010101000001010101010001010100010001000000000000010100011 1010111010101010111111111010101011101110111010101110101110111010111011101110111010111111111110111111 1010101000101010000010000010101000100010001000100010101000100010101000101000100010100000100010100011 1110101111101011111010111110101110101011101111111010101011101110101010101011101110101110101010101011 1000100000001010001000100010100010101000101000001000101010001000100010001000101010101010001010001011 1011101111111010111111101110101110101011101011101011111010111011101111111110101010101011111010111011 1000100000001010000000100010101000101000100010101010000010000010001000000010101000101000000010100011 1010101111111011111010111010101011111110111110101010111011111110111110111011101011101011111111101011 1010101000001000000010001010001010000010000000001010100010000010100010001000001010001000100000101011 1010101011101111111111101011101010111011111111111010101110101010101011101011111110111110101110101111 1010101010000000100010001000101000101000100000000010100010101010001000001010001000100000100010100011 1010111010101111101010111110101111101110101111111110111110101111111111111010101011101111111010111011 1010000010101000101010001000101000100010100000100000100000100000001000001010100010001000001010001011 1111111110101010101011101011101010101010111110101110101111111011101011101010111110111011101011101011 1000000000101010001000001000101010001010001000100010101000001000100010001010100010000010001000100011 1011111111101011111111111110101111111010101011111010101010111110101111111010101111111110111010111011 1010000000101010000000000010001000000010101010001010100010100000101000000010100000000010101010001011 1011101111101011111011111010111011101110101011101010101111101011111011111110111010111110101011101011 1000100000001000000010001010000010101000101000101010101000001010000000000010001010000000100000101011 1110101111111111111111101011111110101011101110101011101011111110111111111111101011111111111111101011 1000100000000000100000001000101000001000100010001010001000001000100000000000001000100000001000001011 1011111111111110111011101110101011111110111011101010111111101011101111111111111110111011101011111011 1010001000000010100010001000100010000010100000101000100000101010101000000000000010100010000010000011 1010111011111010101111111011101110111110111110101111111011101010101110101111111110101111111111111111 1010000010100010001000000010000000100010001000100000000010001010100010100000000000100010000000100011 1010111110101111101011111111111111101011101011111111111010111010111010111111111111101010111110101011 1010000000100000101000001000000000001000101000100000000010100010001010000000000010001000100010001011 1011111110111110101111101010101111111110101110101111111110101110101011111111111010111111101011111011 1000100010001000101000101010101000100010100010100010000010001000101000100000100010000010001000001011 1010101011101011101010101110111010101010111010111010111011111011111110111011101111111110111111101011 1010001010001000100010100010000010101000000010001010001000000000000010001000000000000010101000101011 1011111011111110111110111011111110101111111111111011101111111111101011101011111111111010101010101011 1000101000000010000010001010000010100010100000001000100010000010001010101010001000001000100010001011 1110101111111010101111101010111010111010101111101110111011101010111010101110101011111111101111111011 1010100000001010101000001010001010100010101000100010001000101010001000101000101010000000001000000011 1010111011101011101011111011101010101110101010111011101110111011101110101011101010111111111011111111 1000000010001010001010001000001010100000101010001000101000100010001000101010001010100000001000000011 1111111111111010101010101111111010111111101011101011101110101010101111101010111010101110101111111011 1000000000000010101010100000000010000000001010101000100010101010101000100010001010100010100000001011 1011111011111110101010111111111110111111111010101110111010101110101010101111101010111010111111101011 1000100010001000101010100000000010100000000010101000100010001000101010100000101010100010100000101011 1010111110101010111010111111101110101111111110101011101111101011111010101111101010101110111110101011 1010001000101010000010000000101000100010001000101000001000101000001010101000001010100010100000100011 1111101011101110111111111110101011111010101010101011111010101111101010111011111010111010101111111011 1000001010100010000000100000101010000010100010101010000010100010001010100010001000100010100000000011 1011101010111011111110101111101010111110111110101010101111111010101010101110111011111110101111111111 1000101000101010000000101000100010100010100010001010100000000010101010001000001010000000100010000011 1010111110101011111111101010111110101110101111111010111110111110111011111111101011101111111010111011 1010000010101000000000101010000000101000100000100010100010100000100010000000001000001000001010001011 1111101110101111111110101011111111101011101011101111101011101111101111111011111111111011101011111011 1000001000100010001000101000001000000010001000001000001000001000001000000010000000001000101000100011 1011111011101011101011101111101110111111111111101110111111101011111011111010111011101110101110101011 1000001000001000101000001000100010000000000000100000100000001010100010001010101010001000101000101011 1011101111111110101111111010111011111111111110111111111111111010101010101110101011111011101011101011 1000100000000000000000000010000010000000000000000000000000000010001000100000001000000000100000001311 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 4 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1200001000000010001000000000100000100000100000001000101000001000001000001000001000000000100000100011 1111101011111010111011101110101110111010101011101010101011101011101010101010111010111110101010101111 1000100010001010100010001000101010100010101010000010101010100010100010101010100010001010101010100011 1011111110111010101110111011101010101110111011111110101010111110111110101010101111101010111010111011 1000000010001010101010100000001000101000000010000010001000100000000010101010101000001010001010000011 1010111011101010101010111111111011101110111110111011111110101111101010101011101011111011101011111011 1010101010001010000010000010000000100010100000101000000010101000001010100010001010000000001010000011 1110101010111011111011111011111110101011101111101111101110111011111110111110111010111111111010111111 1000100010001000001010001000000010101000001000001000101000100010000010001000100010100000000010100011 1011101110101111101110101111111010111011111010101010101011101110111010101011101110111011111110101011 1010100010100000100000100000000010001000100010101010001010100010100010100000100010100010000010001011 1010111011101110111111111111111111101110101110101010111010101010111011111111111010101110111111111011 1010000000001000001000100000000000101010100010101010100010101010001000001000100010001000000010000011 1011111110111111101110101111101110101010111110101010101110101011101111101010101111111111111010111111 1000100010100000100000101000101000101010000010101010101010001000101000100010100000000000001000100011 1010101011101110111011101010101111101011111010111011101010111110101010111110101111111111101011111011 1010001000000010100010001010100000001010000010001000101000000010100010100000100000000010001010000011 1011111111111110111110111110111111111010111110101110101011111110111110101111101111111110111011101011 1010000010001000100000100000000000001010100000100010001000100000001000100000101000000010101000101011 1010111010101011101111101111111111101010111111111011111011101111101011111110101011111010101110101011 1010001010101000101000101000100000101010001000000010001010001000001000100000101010000010100010001011 1011101010101110101010101011101011101011101011111010101010111111111110111011111010111110101011111011 1010001000100010101010001000001000101010001000001000101010100000000010001000000010100000101010000011 1010111111111110101011111011111110101010111111101111101110101111111011101111111110101011111010111111 1000100010000010100010001010100000101010000010001000101000101000001000001000000000101000001010001011 1110101010111010111110101010101111101011111010111011101011101010111111111011111111111110101011101011 1000101000101010100000101010100000001010001010100000000010001010100000001000000000000010101000101011 1111101111101010101110101010111111111010101010111111111110111011101111101011111111111011101110101011 1000101000100000100010101010000010001010100010001000000000100000001000100010001000101000100010101011 1010101010111111111010101011101010101010111111101011111011111011111010111110101010101110111010101011 1010101010000000001010101000001000101000100000001010000010001010000010000010100010101000100010000011 1010101011111111101010111111111111101011111110101011111110101010111011111110111110101011101111111011 1010001000001000100010000010000000101010000000101000000000101010001000100010001000100010001000100011 1011111111101110111111101010111111101010111111101111111111101011111110101011101011111010101010111111 1000100000001000000010001000100000001010001000101000000000101000001000101000001000001000101010000011 1010101111111011111010101111101111111011101010101111111010101111101010101111111111101110111011111011 1010000000000010000010101000100010001000001010101000001010100000100010101010000000100010100010001011 1111111111111011111010111010111010101111111011101011101011111110111111101010111010111011101111101011 1000000010001010001010000010001010101000100000001000100010000010000010001000100010101000001000001011 1011111010101010101011111110111010101110101111111010111110101011111010111011101110101111111110101011 1010000000101010101010000010100010100000101000100010000010101000001000100000101010100000000010101011 1011111111101110101110111010101110111110101010111110111010101111101111111011101010101011111010101011 1000100010100010100000100010100010000010101010100010001000101010001000001010001010101010001000101011 1010101010111010111111101110111010111010101010101010111111101010111011101010111010111011101111101011 1010001010001000101000001000001010001010100010101010100000001010001000101010001010001000100000101011 1011111010101111101011111011111010111010111110101011101111111011101010101111101011101110101111101011 1000100010100000000000001000100010100010100010001000001000100000101010100000001000100000100000101011 1110101111111111111111101110101110101111101011111111111110101011101010111111111011111111101110101011 1010100000000000000010101000101000100000001000000000000000101010001010000010001000000010001010001011 1010111111111111111010101010101111111111111111111110111011101010111111111010111011111010111011111011 1000100000001000100010100010100010000000100000100010001010001010100000000010001000101010100010100011 1011111110101011101110111110111010111110101110101010101110111010101111111110101110101010101010101111 1010000010100010001000001000001010100010001010101010101000100010101000100000101000001000001000100011 1011101010111110111111101011111010101111111010101011101011101010101011101111101011111011111111111011 1000001000100000100010001010000010100000000010001000100010101010101010001000100010001000100000000011 1011111111101111101010101010111110111110111011111110101110101110101010111011111110101011101111111011 1010000000001000001010101010100010000010101000000010100010100010101010000010001000101010001000001011 1010111111111011111010111010101011111010101011111010111010111010101011111010101011101110111011101011 1010000000000010100010000010001010000010001000001010101010001000101000100010101000100010101010100011 1011111111111110101110111111111010111111101111101110101010101111101110101110101110111010101010111111 1000100000000000100010100000001010001000101000100010101000100000100010000010100010101010100010001011 1110101110111110111011101111101011101011101010111010101111111110111011111110111010101010101110101011 1000100010000010001000001000001010001000001010100010100000000000000010000000100010100010100010100011 1011111011111011101111111011101010111111111010101110101111111111111110111111101110101110111010111011 1000001010001010101000000010001000100000000010101000101000100000000000101000001000100000101000101011 1111101010101010101011111111111111101011111110101011101010101110111111101011111011111111101111101011 1000001000101010101000000000000000101000101000001010100010101000100010000010001000100010000000100011 1011111111101010101111111111111011101110101011111010111110101110101010111110101010101010111110101111 1010001000001010100000100000001010001010100010000010000010100010101010001000100010001010101000101011 1010111011111010111110101111101010111010111110111111101110111011101011101111111111111010101011101011 1010000000100010000010101000001000100010000010000000101000100010001010100000100000000010101000101011 1011111110101110111010111011101111101011111011111110101011101010111010111110101111111110101110101011 1010001000100010001010000010001000001010001000001000100000101010100010000010001000000000101000100011 1010101111101011111011111110111011111011101111101011111111101110101110101111111011111111101011111011 1010100000101000100000100010100000001000000010101000100000100010100010100000000010100000100010000011 1010111110111110101011101010101111101111111010101110101110111010111010111110111110101110101110111111 1000100010100000101010001000100010001000001000100010001010001000001010001000100010000010101000100011 1111101010101111101110111111111110111010111011101011111011101111111011111011101010111110101011101011 1010001010101000100010000010000000101010000010001000001000001000000010001010001000101000101010001011 1010111010101110101011111011101111101011111110111110111011111011111110101010111111101011101011101011 1000100010100010001000001010001000001010000010000010100010000010000000100010100000001000001000101011 1011101110111011111010111010111010111010111011111010101111101110111111111110101110101111111110111011 1010100010100010001010001010101010000010100000001010100000101000100000000010100010101000000010100011 1010111010101110101011101010101011111111101110111010111110101011111011101010111110111011111010101011 1010001000100000101010001000100010000000001000100010100010001010001000101010000010000010001010001011 1010101111111111101010111111101110111011101111101110111011111010101110101011111010111110101011111011 1000101000100010001010000000101010100010001000001000000000100000101010101000001010001000100000001011 1111101010101010111011111010101010101110111111111111111110111111101010101011111011111011101111111011 1000101010001010100000001010101000101000001000000000100010100000001000101010000000000010001000001011 1011101011111010111111101011101111101110111111111110101110101111111011101010111111111111101011111111 1000001010000010001000101000100000100010100000000010100000001000000010001010100010000000101010001011 1011111011101111101010101110111110101011101111111010111011111111111010111110111010111110111010101011 1000100000100010001010101010000010101010001000000010001010100010001010000000000010100010000010100011 1110111110111010111010101011101110101010111011111011101010101010101011111111111010111011111110111011 1010000000100010101010001000100000101000100010001010101000101000101010000010000010100010001000100011 1011111111101110101011111110111111111111101110111010101111101111101110111011111110101010101011101111 1000000000000000100000000000000000000000001000000000100000000000100000001000000000001000100010000311 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 5 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1200001000000000000010000000001000001000000000000000100010000000000010000000000010001000000000000011 1111101111111110111110111011101011101011111011111110101010111111101110111110111010101011111111111011 1000100000000010000000001010001010001000100010001010101000100000001000100010001010101010001000100011 1011111111111010111111101010111010111010111110101010101111101111111011101011101011101011101010101011 1000000000100010100010001010000010001010000000101000100010001000000010001000001000001000001010001011 1011101111101111101011101011111111101011111111101011111011111011111110111110111111111111101011111011 1000100000001000101000101010001000101000001000101000000010001000000010100000100000000000001000100011 1110111111111010101110111010101010101111111010101111111110101111111010111011101111111111111110101111 1010100000100010101010000010100010001000000010100000100000100010000010001000101000100000100000100011 1010101010101110101010111111101111111011111110101110101111111010111111101111101010101010101111111011 1000101010001010101000100000100000000010001000100010001000100010101000001000001010001010101000000011 1011111011111010101111101110111111111110101011111011111010101110101011111011111111101011101111111111 1000001010001000100000000010100010001000101010000010001010001000101000000010000000101000100010000011 1111101010111011101111111110101010101011111010111110101011101011101111111110111110111010111010111011 1000100010001010001000100010001010101000100010101000101010001000100000100010001010001010001010100011 1010111110101011111010101010111010101110101110101011101011111110101110101011101011101010101010101011 1010001000100010000010001010100010101000100010001010000010000010001000001000101010001010101010101011 1110111011111110111111111011101110101010111011111011111110111011101111111110101010111010101010101111 1000100010000000100010001000101000100010101010001010000000001000001000001010101010100010101000100011 1011101111101011101011101110101010111110101010101010111111111011111011101010101010111110101111111011 1000001000101010001000000010001010001000001010101000100010001010000010001000101010000000100010001011 1011111010111010111111111111111011101111101010101011101010101110111110111011101011111111111010101011 1010000010001010001000000000001010100010001010101000001010100000100010100000001000001000000010100011 1010111111101011101011111011111010111011101010101111111010111111101110101111111110111011111110111011 1000100000101000100000101000000010001000101000101000001010100000001000101000100010000000000010100011 1111101110101010111110101111111110101110111111101011101110111110111011101010101011111111111110101111 1010001010001010001010001000000000100010000000101010100010000010001000101010001000100010000010100011 1010111011111111101011101111111110111011101111101010111011111011101110111011111110101010111010111011 1000100000000000101000100000100010100000100010001010000000000010000010000010000010001000100010100011 1011111110111110101110111110101011101110111010111011111111111110101111111110111111111111101110101111 1000000000100000100010000010001000001000101000100000000000100000101000000000000000100000101000101011 1111111111101111111010101111111111111011101111101111111110101011111011111111111110101010101011101011 1000000000101000000010100000001000001000001000001000100000101010001000100000001010101010101010000011 1011101111101110111111101011111010111111101111101110101111101110101110101111101010101011101011111011 1010001000100000100000101000100010000000100000100010100010100000100000001000001010001010001010001011 1110101010111111101010111110101111111110111110111010111010101111111111111111101011111010111010101111 1000101010000000001010000010101000100000001000100000001010000010000000001000100000001010100000100011 1011111011111011111011111010101011101111101011111111101011111110111111101010111111101010101111111011 1010000010001000001010000010101000100000101010000010001010000000000000101010001000101000100000001011 1010111110101110111010111110101110111110111010101011111010111111111111101011101010111011111110111011 1010000010101000100010100000100000001010000010101000001000000010100000100000100010001010001000100011 1011111010101111101110111010111111101011111111101111101011111010101110111110111111101010111011101111 1010000010100000001010000010001000100010000000001010001010001000101010001000100000001010000000100011 1010111110111111111011111111101010111010111011111010111110101111101011101111101111111011111111111011 1000000010101000001000000000001010001010001010001000000000100010001000101000001000100010000010000011 1111111110101010111011111111111110111010101110101111111111111010111010101011111010101110111010111111 1000000010100010001000100000100000100010101000101000100000000000100010101010000010001000101010000011 1011111010111111101110101110101110101110101011101010111111111111111110101011111011111011101010111011 1000100000100000100010001010101000101000100010001010100000001000001000101000001000000010001010001011 1010111111101110111011111010101111101111101110101010101111101011101011101011101111111110101011101011 1010000000000010001000000010100000100000100010101010000000101010101010001010100010000000101000101011 1011111111111111101010111110111110111110111010111011111111101010101010111010111011111110101110101011 1010100000000000001010000010100000101000100010000010000000001010000010001010001000100010101000101011 1010101111111011111011111010101110101011111110111110111111111011111011101010111110101010101011111011 1010100000100010001000001010101010101000100010101000100000000000001010101000100000101000101000000011 1010111110101110101011111010101010101110101010101011111111111110101010101111101111101111101111111011 1000000010100010101010000010101000000010001010001010000010000010101000100000001000001010000000001011 1111111010111010101010111110101111111011111011101010111010111011101111111111111110111010111111111011 1000100010001010101010100000100000100010001010001010101000001010001000000010000000101000101000001011 1011101111101110101010101111111110101111101011111010101111111010111011101010111111101011101011101011 1010001000100000101010000000000000101000001000001000000000100010001000101000100000100010001000100011 1010111110111111101011111111111111101110111111101111111110101111101011101111111110101111101110111111 1000100000001000001010000000001000001000100000100000100000100000100010001000000000101000000010000011 1011101111101011101110111111101011111010101110111110111111111110101110111011111110101011111111111011 1010000010101000101000101000001000000010100010000010100010000010101000100010100000101010000000001011 1011111010101110111011101011111111111111111011111010101010111010101011111010101111101010111110111011 1000100010100010001000001000100000001000001010001000101000101000101000100010001000000010100010000011 1110101110111011101111101110101111101011101010101111101111101111101110101110111011111110101011111111 1010001010000010100010001010001000100010100010100000001000000010001010101000100010001000101010000011 1011111010111110101110111011111110111110111110111011111111111010111010101111101111101011101010101111 1010000010000000100000100000000000100010000010101000100000000010100010100000101000001000001010100011 1010111011111110111111101111111010101010111010101110101011111110101110101110101011101111111011111011 1000001000000010100000100000100010101010101000100010101010000000100010100010000010000000101010000011 1011111110111010101010111111101110101010101111101010101010111111111010111111111111111110101010111111 1000100010001010101010100000001000101010100000001010101010100000000010100000001000100000001010001011 1111101011111010111010101111111011101110101111101110101110101111111110101111101010111111111011101011 1000101000001010000010001000001010000010100010001000101000100010000000100010100010000010001010001011 1010101111101011111111111011101011111010111010111011101011111010111111111010111111111010101010111011 1010001000101000000000001000100010001000000010001010001000001010000000001000001000001000100010001011 1011111110101011111111101110111110101111111111101010111111101011111110111111101110111111111111101011 1010000010001000100000100010101000100010000010001010000010001000000010000000100010000000000000101011 1010111011101010101110101110101010111010111011111010111010111010111011111110111011111011111110101011 1000101000101010000010101000100010001010001000000010100010001010101010000010000010000010000010001011 1011101110101111111110111011101111101011101111111110101111101110101010111011111110111110101011111011 1000001010100000000000100010000010001000100000100010100000100000100010001000000000100010101010001011 1111101010111111111111101110111110111110101110111010111010111111101111101111111011101011101011101011 1000101010000000001000001000100010100010100010001000001010100000100000100000100010001010001000001011 1110101011111111101011111111101010111010111111101111111011101011111110111110101110111010111011111011 1000100010000000100010000000001010001010100000101000100010001010000000101000100010100000100010000011 1011111010101111111111101111111010101010101110101010101010111010111111101011111010111111101110111111 1010001010101000000000100010000010101000001000101010101010100010001010000010100010001000101000100311 1010101010101011101110111010111111101111111011101010101110101011101010111110101110101010101011101111 1000100010100010001010001010000000100000001010001010001000101000101000000000101000100010101010000011 1011111111101110111011101011111110111110101010111011101011101111101111111111101011111110111010111011 1010001000100010100000001000001010000010101010001010001010100000100000001000001010001000100010001011 1010101010111110101111111111101011111011101011101011111010111110111111101011111011101011101111111011 1000100010000000100000000000001000000000001000001000000000000010000000000010000000001000000000000011 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 6 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1210000000000010000000100000000000000010000000000000000010000000100000000000001000100000000000000011 1010111111111011101110111110111111111011111110111111111011101110101111101111101010101011111011111011 1010000000001000100010000010101000001010000000100000001000001010100010001000001010101000100010001011 1011111111101110101011111010101010101010111111101111101111111010111110111011111010101110111110101111 1000100000001010101010001000100010101000100000100000100000000010000010001010001010101010000000100011 1110101111111010111010101111111110101111101111111110111111101111111011101110101010101011111111111011 1000101000100010000010100010000000100000100010001000100000100010000010001000101010100000000010001011 1011101010111011111110111110101111111110111010101011101110111010111110101011101010111111111010101011 1000101010100000101000100000101000100010100010101010101000001000101000101000100010000010001000101011 1110101010101110101010101111101010101010101110101010101011101111101010111110111110101110101111101011 1010100010101000001010001000101010001000001000100010101010001000100010100010100010101000101000001011 1010111110101111111011111110101011111111111011111110101011111010101110101010101010111011101011111011 1000100010101000000000000000101010001000100010100000001000000010001010001000101010000000101000001011 1011101010101011111111111110101010101110101110101111111111111111111011111111111011111111101110111011 1010001000101000100000001000101000100000100010001000000000100010000010000000000010000000100000100011 1010111111101011101111101011101011111110111010111011111110101010111011101111101110111110111110101011 1010001000100010001000001000101010000010100010001000100010101000101000101000001000100010000010101011 1010101010111110111111101111101010111011101111101110101010101111101110101111111011101111111011101011 1010100010100000100000100000001010101000001000101000101000101000100010100000100010100000001000001011 1011101110101111101110111111111010101111111011101011101111101010111010111110101110101111101111111011 1000101000100000000010001000100010000010000010001000100000101010000010000010100010100010000010100011 1110101011111011111011101010101111111010111110111110111110101011111011111010111010111010111010101111 1000101010001010001000101010000010000010100000100000100010001010001000001010001010000010001000101011 1011101010101110101110101111111010111110101111101111101011111010101011111011101011111011101111101011 1000101000100010100010100000100010100010001000001000001000101000101010001010001000001000100000000011 1110111110111010111010111110111110101010111111101011111110101011101110101010111111101111111011111011 1010000010001000001010100000100000101010100000100000000010100010001000100010000000101000001010001011 1011111011111111111011101110101111101010111010111110111110101110101011111111111110101011101110101011 1000001010000000000010001000101000101010000010001010100000101000101000100000001000100010100010101011 1011101010111111111110111011101010101111111111101010101111111011101110111011101010111110111010101011 1010001000100000001000101010100010101000000000101000101000000010100010001010001010100000001000101011 1011111111101111101010101010111110101011101011101111101011111110111011101010111010111011101111101011 1010000010001000001010101000000010101010001010001000001000001000001000100010000010001010101000001011 1010111010101110111010101011111110101010101110111011111011101011111011111111111111101010101011111111 1000101010100010001010100010000000100010101000100000101010001000000010000000000000101010001000000011 1011101010111011101010111010111111111110111011101110101010111111111110111110111111101011111111111011 1010001000100010101010001010100000000010000010001000100010000000000000100010000000000010000000000011 1010101111101110101111101110101011111011101110111011111011111111101111101111111111111110111111111011 1010100000101000001000101000101010001000101000001010001010000000101000100000000000100000100000000011 1011111110101110111010101011111010101110101111111010101110111110101010111010101111101111111110111111 1000001000100010100010001000000010101000100000001000101000000010100010001010101000101000100010100011 1111101011111010111011111111111110111011111111101011101011111110111111101010111010101010101010111011 1000100010000010000010000000000000100010000010001010001000100000101000001010001010100010001010000011 1010111110111011111110111011101111101110111010111110111011101111101011111111101010111111111011111011 1010100010001010001000101010001000100000101010000010100010001000100000100000101010001000001010000011 1010101011101010101011101011111010111111101011111010101110111010111110101110101011101011101010111111 1010001000001010100000001000100010001000001010100010000010000010001000100010001010001000100010100011 1011111111111110111111101110101111101011101010101111111111111111101011111011111010111110101111101011 1000000000100000100000100010001000101010100010100000100000000010001000100010001010000000101000001011 1011111110101111101110111111101010101010111110111110101111111010111110101010101010111111101011111011 1010001000100010001000100000101010001010001000000010101000100010100010101010100010100000101010001011 1110101011111010111011101110111011101010101011111110101110101110101010101010111111101110111010101011 1000100010001010100010001000000010101000101000000000100010101000101010101010000010001010000000101011 1010111110101010111010111111111110101111101011111111111010101110101010101111111010111011111111111011 1010100010100010001010000000001000101000101000100010000010100010101010101000001000100000100000100011 1011101010111111101011101111101010101110101110101010111110111010111010101010111111101011101110101011 1010001000000010001000101000001010000000101000001010100000001010001000100010000000101010001010101011 1010111111111110111110111011111111111110101011111010101111101011101011111110101110101110111010101011 1000100010000000100010100010001000001000101010001000100000100000001000000010101010101000100010101011 1011101110111111101110101110101011101111101110101011111011111111111111111011101010101011101110101011 1010001000100000100010101000101000101000101000101010001010001000000000100010001010001000100000101011 1011101011111110101010101011101110101010101011101110101110101011101011101110111011101110101111101011 1000001000000010001000101000100000100010001010001000100000101010001010001000100000101000100010001011 1111101111111011101111101110111111111111111010111011111111101110111010111110101011101011111011101011 1000001000001000101000000010000010000000000010000010000000100010001010100000101010001000001000001011 1011111110111110101011101111111011101111111111111110111110111010101110101111101110111111101111111011 1000000010001000101010001000000010001000001000000000001010001010100010001010001000100000100010001011 1111111010101011101010111011111110111011101111111111101011101011111011111010101011111110111010111011 1000001010101010001010100010000010000000100000001000101000100000001000000000100000100000001010100011 1011111011101010111011101111101011111111101111101010101011111111101111111110111110101110111010101111 1000100010001010000010001000101010001000100000100010101000001000101000000010100010101000100010100011 1010101110111010111110111010101010101010111110111110101110111010101011111011101010101111101110111011 1010101000100010100000100010001000100010000010101000100000100010101000101000001010001000001000001011 1010101010101110101111101111111111111111111010101011101111101110101110101111111011101011111010111011 1010001010101000100010000000000000000000001010001010001000001000100010100000001010001000101010001011 1011111011101011111011111111111111101111101011111011111011111011111010111010111011111110101011101011 1000001010001000101000001000000000100010001000000010001000100010001010001010100000000000100000100011 1111101010111110101111101011111110111010111111111010101110101110111010101010101111111111111111101111 1000100010000010001000001000001000001010000000001010100000101000001010101010001000000000000000101011 1010111111101010111011111110101111101111111110101110111111101011101011101111111011111111111110101011 1010000000101010100010000010100010001000000010100000100010001000100000001000001000000010100000101011 1011111110111011101110101010111010111011111010111111101010111111111111111011101111111010101111101011 1010001000000010001000101010100010100010001010100000001010100010000000100010100000100010101000101011 1010101111111110111011101011101110101111101011101111111010101010111110101110101111101110101010101011 1000100000000010100000101000101010101000001000101000100010001000100010001000101000100000101010101011 1011111111111010111111101110101010101011111110101110101110111111111011111011101010111011101011101011 1010000000100010000000001010101000101010000010101000100010001000000000100000101010100010001010001011 1010101110101011111111111010101110101010101110101011111011101011111110111110101010101110111010111011 1010100010101000100000001000100010001000100000101000000010100010000010000000100010000010100010100011 1011111010101110101111111011111011111011111111101011111110111110101010111111111011111110101110101011 1000000010100010101000001000000010000010001000001000100000001000101010100000001000100000100010001011 1111111111111010101011101111111110111110101111101110111111101011101110101111101111101111101011111011 1000001000000010001000100000000000100000100000001010100010001000100000100010101000101010001000001011 1011101011111110111110111111111111111011111111111010101010111011111011111010101010101010111110111011 1010000010001000100010100000000000000010100010000010001010000010001000001010001010001010001000100011 1011111110101111101010111111101111111110101010101111111011111110101111111010111011111011101011101111 1000000000100000001000000000001000000000001000100000000000000000100000000010000010000000001000000311 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 7 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1210001000000010000000000000000000100000000010000000001000000010001000001000000000001000000000000011 1011101011101110111111111110111010101011111010111011101111101010101010111010111111101111111011111011 1010001010100010000010000010100010101010100010100010100000101000100010100010000000100010001000100011 1010111010111011101110111010101110111010101111101110111110111111101110101111111110111010101111101011 1010000010001010001000100010101010001010101000001000100010001000101000100010000010100000100000001011 1011111010101010111011101111101011101010101010111010101011101010111010111011111010111111111111111011 1010001000101010100010100000001000101010001010100010001000001010000010100010000010100000000000001011 1010101011111010101110111111111010101011101110111011111110111010111111101110111010101111111111101011 1000101010000010100010000000000010101000100010001010100010000010100000001000101010100000100000101011 1111101010111110111010111110111011101010111011101010101011111111101111111011101010111110101111101011 1010001010000000101010100010100010001010001000101010101000000000000010000010001010000000001000101011 1010111110111111101010101010101110111111101110101010101111111111111010111110101011111111111010101011 1000100010001000001010001010101000100000001000001010101000001000001000100000100010000000000010101011 1011101011101110101011101110111011101110111111111010101110111011101111111011111110111111111110101011 1010001000100010101000101000100000001000100000100000100000100010100000001000001000100000100000101011 1010111110111010101110101011101111111111101110101111111011101110111111101111111011111010101111101011 1000100000101000101010101000001010000000000010101010000010001000000000101000001010000010100010001011 1111101111101111101010111111101010111111111110101010111110111111111010101011101010101111111010101011 1000100000100000100010100000100010100000100000100010001010001000001010100010001010101000000010101011 1010111110111110101110101110111110101111101111111011101011101011101011111110111010101011111111101011 1010000010000010101000100010000010101000100010001000101000100000101010001000100010101010100000001011 1011111011111010101011111011111010101010111010101011101110111110101010101011101110101010101011111011 1000001000001010101000000010001000100010100010101010000000100010101000101000001010100010001010000011 1111111010111010101111111110111111111110101010101110111111101011101111101111111010111111101010111111 1000000010100010000000100000000000000000101010100000001000001000100010000010000000100000101010100011 1011111110101111111110111110111111101111101110111111111011111110101010111110111111101110111010111011 1000100000101000001010000010000010100000100000100000000010100000101010000000100000100010000010001011 1010111011101011101011111011111010111110111110101111111110101111111010111111101110101011111111101011 1010001000100010001000001010000010100000100010100010000000101000001010001000000010001010000010100011 1011101111111110111110111011101110101110101011101011101111101110101011101111111011111011101010111011 1010101000000010000010001000100000101000101000101010001000001000100010100000001010001010001000001011 1010101010111111111011101110111110101011101110101010101011111011111110111111101010111010101111101011 1000101010000000001000100000001000101010001000101010101010000010000000100000101000100010101000101011 1111101011111110111110101111101111101010111011111010111010111010111111101010101111101110111010111011 1000101010001010000000101000100010001010101010000010100010001010100000001010100000001000000010100011 1010101010101011111111111010111010101110101011101110101111111010101111111010111111111011111110101111 1010101000101000001000100010001000101000101010001010001000100010000000100010100010001010000010100011 1010101111101110101010101111101111111011101010111010111010101110111111101111101010101010111010111011 1010000010101000101010101010001000000010001000101000100010100010100000001000001000101010100010000011 1011111010101011101010101010111011111110101111101011101110111010101111101011111111101010101110111111 1000100000101010001010001000100010000000100010000010001010000010100010001010100000100010101000100011 1010111111101010111011111011101111101011111110111110111011111110111011101010101110111110101011101011 1010100010001010001010001010001000101010000010001000100000100000101000101010001000100000101010001011 1010101010111011101011101010101010111010111011101110111110101111101110101011111011101111101110111011 1010001010001010101000101010100010100010100000101000100000100000001010101000000010001000100010100011 1111111011101010101110101011111110101110101011101011101110101111101010111110111110111010111010101011 1000100000100010100000101000100000100000101010001010001000101000100010000010100010100010001000101011 1010101111111110111111101110101111101111101010111010111111101010111111101110101010101111101111101111 1010100000000010000010000010100010101000101010100010000000001010000000100000101000100010001000100011 1010111010111011101011111010111010101011101010101110111111111011111110101111101111111010111010111011 1010001010001000101000000010001010001010001010101000001000101010000010101000001000000010001010001011 1011101011101110101111101111101010111010111110101111101010101010111010111011111011111111101110101011 1010101010001010101000001000101010001010000000100010001010101010001010001010000010000000100000101011 1010101110111010101011111010101011101011111111111010111010101011101011101010111110111011111011111011 1010000000100010101000100010100010100000000000100010001010001010001000100000100010101000000010001011 1011111111111010101111101110111110111111111110101111101011111010111111111111101110101111111110101011 1000100010001000101000100010000000001000000010101010001000100010100000000010001000000000100000100011 1110101010101011101010111011111011111010111110101010111010101110101111111010111011111111101111111011 1000101000101000100010100010001000001010000010101010001010100000100000101010000010100000001000000011 1011101111101110111110101111101111101011111010101011101110111110111110101010111110101111111111111111 1010001000001000100000100000100010001010001000101000100000000010000010101010001000100000100000000011 1010111011111011101011111110101110111010111111101011111011111111101110101011101110111110101111111011 1010001010001000001010000000001000100010100000001000000010001000001000101010000000001010101000100011 1011101010111111111010111111111011101110101011111111111110101011111011101010111111101010101010101111 1000001010000000000010001010000010001000101000100000100010100000001010100010001000100010001010100011 1111111011111011111111101010111010111110101110101110101010111111101010101111111010111111101011111011 1000000010001010000010001010001010000010000010001000101000100010001010001000001010000000100010001011 1011111010101110111010111011101111111011111111111011101111101011111010111011101011111110111110101011 1000100010100000101000100000101000001000000000001000001010001000000010000010100010000010001000100011 1010101110111111101111101111101011101111111111101011111010111111111111111110111110111111101011111011 1010100010100000000010000000100010100010000010001010000010000010001000001000001010000000001000001011 1010111110101110111010111110111110101110111010111010111011111010101011101010101010111111111111101011 1010100000100010100010000010000000101000100010001010001000100010101010100010101010100010000000101011 1110101111111110101111111011111110101011101111101011101111101110111010111110101010101011111010101111 1000100000000010100000001000001000101010100000001000001000001010001010100000100010001000100010100011 1011111111111010111111101111111010101010111111111111101011111010101010101110111111111110101110111011 1000000000001010000000100000000010101000101000000000101000100000100010100010100000001000101010100011 1011101111111010111110111111111110101110101010111110101110101111111110111011101010111011101010101011 1010100000000010100010100000001000100000101010100010101000100010000010100010001010100010001010101011 1010111111111111101010101111111011111111101010101010101011111010101010101110111011101110111010101011 1010001000000000101000100000100010000000100010101010101000101010101010100000001010001000100010001011 1010101011111010101111111110101110101110101110101010111110101011101010111111111010111011101011111011 1010101000101010101000001000101000101000101000101000000000100010001000100010001010100010101000000011 1011101110101010101011101011101011101011111011111111111111101110111110101010101010101110101111111111 1000101000001010101010001000001010001010001000000010000000101000000010101000100010001000101000001011 1110101011111010101010111011111010111010101111111010111111101111101011101011111011111110101110101011 1010101000100010100010101000100010101000100000000010000000001000101010001010001010000000101000100011 1010101110101110101110101110111110101111111111111110111111111010111010111110101110101111101011111011 1010100010101000100010100010100000100000000000000010100000000010100010000000100010100000101000100011 1010101010101011101110101010101111101110111111111010101111111110101111111111111010111110101010111111 1010101000101000101000101010100010001010000000100010101000001010100010000010001010000010001010000011 1010111111101110101011101010111010111011111110111110101110101010111010101110101011111011111111111011 1010000000100010101010001010100010001000000010000010101000100010001000100010100010000010000000100011 1011111110111010111010101110101111101110111011111010101011111111101011111010111110111111101110101011 1000100010000010000010100010001000100000101010001010001000000000101000001010100010100000001010101011 1010101011111111111110111011111011111111101011101011111011111110101111111010101010111110111010101011 1010001000000000000000001000000000000000000000001000000000000010000000000010001000000000100000001311 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 8 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1210100000100000101000001000000000000000100000000000000000001000000000001000000000001000000000000011 1010101010101110101010111011111011111111101111111111111110111011111111101010111111101011111111111011 1010101010001000101010000010001000000000100010001000000010000000100000100010100000001010000000100011 1010101011111011101011111111101111111110111010101011111011111111101110101110111011111110111110101011 1010001010001000001010000000000000100010000010101010001000100000101000100010001000000010100000101011 1011111010101111111010111111111110101011111110101010111110101110101011111111101111111010101111101011 1000100010100000000000100000000010001000000000101010000000101010101000000000100000100010100010001011 1110101110111111111111101111111111111111101111101011111111101010101111111110101110101110111010111011 1010101000000000001000100000000000000000001000100010000000001010001010000000100010101000100010001011 1010101011111111111010101111111111111111111010111110111111111011111010111111111010101110101111101011 1000100010000000001010101000001000000000001010001000100000100010000010000000101010100010100000001011 1011101110111111101010101011101011111111101011101010111110101010101111111110101010111010111111111011 1010000010001000001010101000101000000010001000100010100010001000100000000000100010001010001000000011 1011111011101110111010101110111111101011101110111110101011101111111111111111111111101010101110111111 1000100000100010000010100000100000101000100010100010101000101000100010000000001000001010100010100011 1110101111111011111110111110101110111110111010101011101110101010101011111110101011111011111010111011 1000101000000010000010100000101000000000101010101000001010101010001000100000101010001000001010100011 1011111011111110111110101111101111111111101010101111111010101011111110101111101011101111101010101111 1000100010000010000000100000100010001000001010100010000010100010000000100000100010001000100010100011 1110101110111010111111101111111010101110101010111010101110101111101111111110111110101011111110111011 1000101000001010100000101000001000100010101010000010100010101000100000000010000010100010001000000011 1011101111101110101110101011101111111010101011111010111010111010111111111011111010111110101011111011 1000100010001000101000101000101000000010101000001010100010100010000010100010001010000000101010001011 1110101010101011101111101110101011111111101111101011101010101111111010101110101011101111101010101111 1000101010101010001000101010100010001000000000101000001010001000100010000000101000101000100010100011 1011111010111010111010101010111110111010111110101111111011111010101111111111101110101110111110111011 1010000010000010100010000010100010001010000010100010000010000010101000100000001000100010000010101011 1010111110111110101111111110111010101011111011111010111110111110101010111011111011111011111010101011 1000100000100000100010000010001010100010100010000010100010001000100010001000001000101000000010101011 1111101111111110111010111010101010111110101110111111101011101011101111101111101110101111111010101011 1010001000000010000010101010101010001000100000100000001000101000100000101000100010100000001010001011 1010111010111010111110101011101011101010111111101110111110101110111110101010111010101111101011101011 1000100010001010000010101000001000101010100010001000100000101000000010101010001010101000001000101011 1011101111101011111110101111111011101010111010111011101111101111111010101111101010101110111110101011 1000100010001000001000100000001000001010000010001000101000000000100010100000101010100010100000101011 1110111010111111101011111011101011111011111010111110101111101110111010111110101010101011101111101011 1000100010000010001000001000101010000000100010100000100000100010001010001000101000101000100010001011 1011101111111010111111101110101010111110101110101111111110111111101010111011101111101110111010111011 1000100000001010000000101000100010001010101000100000100010000000101010100010000010001010100010101011 1110111111111011111110101011111011101010111011111110101010111110101011101110111110111010101110101011 1000100010000010100010101010001010000010000000100000101000100010001000101010000000000010000010001011 1011101010111110101010101110101011111011111110101111101111101011111110101010111111111011111111101011 1000001010101000001000101000101000100010000010100010000010001000100010001000100010000000001000001011 1111111010101011111111101011101110111110111010111011111110111110101111111011101011111110111011111011 1000001000100010000000100010001010000010100010001000100010000010100000000010001000001000100000100011 1011101111101111101110111110111011111010101111101110101011111010111111101110111111101111101111101011 1000100000100000001010000010100010001000101000101010001010001010000000101000100000100010001000101011 1110111110111111111011111010101110101111101010101011111010101011111110111011111110111010111010101111 1010000010000000000010001000101000100000101010101000001010100010001010001000100010001010101010100011 1011111011111111111010101111101011101110101010101110101010111110101011101110101011101010101010111011 1000100010000000001010100000001010101000100010100000101010100000100010100000101010001000001010001011 1110101111111010101010111011101010101110111110111111101010111011111010111111101010101111111011101011 1000101000001010101000100010001000100010000010000010001010001010001000100000001000101000100010001011 1010101011101010111111101011111011111011111011111010111011101011101110111011111111101010101111101011 1010100010001010000010001010000010000010100010100010100010101010001000100010000000100010100000101011 1011111110111111101010111110111110111110101110101111101010101010111011101110101111111110111110101011 1000000000100000001010001000100010100010101000100000101010100010000010001000101000000010100000101011 1011111111111011111011101011101010101010101010111110101010111110111110101111101011101010101111101011 1010000000000010001010100010001010001010000010001000101010000010100000100010001000101010101000101011 1010111111111110101010111111111011111011111111111011101011111010111111111010111110101110101010101011 1000100000000010100010000000000000001000000000000010001000000010001000000010001000100000101010001011 1111101011111110111111111011111110111111111111111111101111111111101011111111101011111111101111101011 1000001010000010001000001000100000100010000010000000100000000000101010000000001000001010001000100011 1011111010111011101011101110111111101010101110111010111011111110101010111010111111101010111010111111 1010001010001010001010000000100000101010100000001010001010001000100010100010100000100010001010100011 1010101010111010111011111111101110101010111111111011101010101010111111101110101110111011101010101111 1010100010100010001000000000001010001000100010000010101010101010001000001010100010001000100010101011 1010111110101011101011111111111011111111101010111110101010101010111010111010111011101110111110101011 1010001000101010001000100000100000000010001000100000101000101010100010001000100010100010100010101011 1111101011101110111110111010111111101010111111111110101111101010101111101111101110101110101110101011 1000001000100000100010001010000000101010100000000000100010001010100010001000101000100000101000100011 1011101110111111101011101011111110101110101110111110111010111011111010111010101010111111101011111011 1010100010100010001000001000100000001000100010100000100010101010000010001010101010000000001010100011 1010101110101110111111111010111111111010111110111111101110101010111111101010101011111011111010101111 1010101000100000100000000010000000100010100010000000001010101000101000001010100010000010000010100011 1010101011101111111011111110111110101111101011111111101010101111101010111010111011111110111110111011 1010001010001000001000100010100000100000001010000000101010100000101010100010000010000000100000001011 1011111010111011101111101011101110111111111010111110101010111010101011101111111110111111111110101011 1000000010100010001000001000001000000000001000001000101010000010001000101000000010001000000000101011 1011111110111010111011111111111111111111111110111011101011111111101110101011111011101111101011111011 1010000010001010000010000000000000100000000010100010101000001000100010100010001010001000101010000011 1010111011101011101110111111111110101111111011101110101010101010111010111110111010111010101110111111 1000101010101010001000100000001000101000001000100010101010101010001010000000100010000010100010100011 1111101010101010111011101110101011101110101110111010101010111011101010111111101111111110101010101011 1000001010000010001010001000101000100010101010100010101010000000100010000000000000100000101000101011 1111101011111111101011111011111110111010101010101110101011111110111111111111111110101111101111101011 1000001000000000101000001010000010001010100010101000001010001000001010001000001010101000000010101011 1011111111111110101111101010111011101010111110101111101110101111101010101011101010101111111010101011 1010000000000010100000101010001000001010000010100000100010100010000010100010101000100000100010001011 1010111110111010111110101011101111111011111010101110111010111010111110111110101110111110101111111011 1010101000100010100000101000101000000000100010100010001000101010100000100000100010001000100000001011 1010101011111010111110101011101111101110101010111111101111101010101111111011111011101011111111101011 1010101010001010000010101000100000101000101010000000100000100010100010000010000010101000100000101011 1010101010101011111010101010111110101011101111111110111110101111111010111110111110101110101011101011 1010101010101000100010101010000000101010000000100010100000101000100010001000100010001000101000100011 1010101010101111101111101011111111111010111110101010101111101010101110101011101011111011101110111011 1000001000100000000000001000000000000010000010001000001000000010001000100000001000000010000310000011 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 9 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1200100010000010000000000000000010001000001000000010000000000000100000000000001010000010000000000011 1110101010111010111011111111111010101011101011111010111110111110111011111111101010101110111110111011 1010101010101000100010001000100010100000101010100010100000100010000010000010001000100000101000100011 1010101110101111101110111010101110111111101010101110101111111010111110111010111111111011101011101111 1010100010101000001010000010100010000010001010100000100000100010100010001010000000001000001010001011 1010111010101011111010111110101110111110101010111111111110101110101010111011111111101111111010111011 1000100010001010000010100000101000100000101010000000001000100000101000100010000010001000100010001011 1011101111101011101010101110101011101110111011111110101010111110101111101110111110111010101111101011 1010000000101000101000101000101010101010100010000000101010100010100010001010000000100010001000100011 1010111110101110111111101011101010101010101110111111111011101011111010111010111111101111111010111011 1010001000100010000010001000101010101000101000000010001000001000001010100010100000001000001010001011 1011111011111011111010111111101010101111101110111010101111111111101010101010101111111111101011101011 1000001010000000101010000000001000100000100010001000100000001000100010101010001000000000001010100011 1111101010111110101011111111101110111110111011111111111010101010111110101111111111101110111010111111 1000001000100010001000000000100010001000001000000000001010100010101000100000000000101010100010000011 1011111111101011101111111110111011101011101111111111101010111110101011101011111110101010101111101011 1000000000001010101000000010001000101000100010000000101010100000101010101000001010001010100000101011 1111111111111010101111111011101011101110111110111110101110101111101010101111101011111010111110111011 1000001000100010001000000010001010001010000010100010000000100010001010001010001000100000100010000011 1010111010101110111011111110111010111011111010101111111111111010101010111010111011101111101111111011 1010100010001000000010000000100010000000101000101000000000101010101010000010001000001000101000000011 1011101111111011111110111111111111111110101111101011111110101010101011111011101011111010101011111111 1000100000001000100000100000100000100000100000001010000010101010101000101010101000100010001010000011 1010111111101111101111101110101011101111111110111010111010101010101110101010101110101111101010111011 1010000000100000100000001000101000001000100000100010001010101010101000100010100010101010001000101011 1011101011111110101111111010101111111010101011101110101110101010101011101110111010101010111111101011 1000101010001000100000101010101000000010101010001000100000100010101000101000001010101000100000001011 1111101110101011111110101011101011111110101010111011111111111010101110101111101010101011111110111011 1000100010100010000010001000001000000010001010101010000000001010100010100010001010001000000000100011 1010111010111111111011101111111111111011111010101011101111101011111010111010111011111111111110101111 1010000010000000001000000000100000000010000010101010001000001010000010100000100010001000000010100011 1011111111111111101111111110101110111111111110101010111011111010111110111111101110111011111010111011 1000000000000000100000001010001000100000100010101000101010000000100010000000100010000010001010101011 1011111111111010111111101011101111101110101010101111101011111111101011111110111011111010101010101011 1000101000000010001000001000001000101010001000100000000010000000001000000010001000001010101000001011 1110101011111011111011111111111010101011111111101111111110111111111111111011101111101010101111111011 1010001010100010001000000000000010001000000000100000100010001000100000001010001000001000100010000011 1011101010101110101111111111111111111110111111111110101011101010101111101010111010111111111110111111 1000101010001000100000000000001000001000100000000010001000100010100010001000100010100010000000100011 1011101011101011111111111110101011101011101110111111111110101110101110101111101110101010111111101011 1000001000101010001000001000100010001000101010001000001000101000101000100000001010101000100000001011 1011111110111010111011101011111111101110101011101011101011111011101011101111111010101111101011111011 1000000010000010100010001000000000100010100000100010100010000010001000101000101000100010001010001011 1110111110111110101110111111101110111010111110111110111110111110111110111010101011111010111011101011 1000100010000000101000100000101010001000000010000000001000001010001010000010100010001010100010001011 1111101011101111101011101010101011101111111011111111101110101011101011111110101111101011101110111011 1000001010001000101000101010100000100010001010000000100010101000100010000010100010001000100010000011 1011111011111010101110111010111111111010111010101111111011101110111010111010111010101110111010111111 1000101000001010001010000010100000001010000010100000001000001000001010001010101010100010000010100011 1110101111101011111011111110101111101011101111111111101111111011101010111010101010111011111110101011 1000101000001000001000000010001000001000101000000000001000100000101010100010100000100000101000101011 1011101011111111101010111111101111101110101110111111101110101110111010101010111111111110101011101011 1000100010000000101010000000001000100010100000100000100010100010100010101010000000000010101000001011 1010101110111110101111111111101010111010111111101111111010111010101111101011111111111010101111111011 1010100000100010100000100000101010101000100000000000001010000010100010001010000000100010000010001011 1110111111101010111110101110101010101111111111111110101011111110111010111010111110101111111010101011 1000100010001010100000100010101010100000000000000010101000000000101010100010100000001000001000101011 1011101010101010101111111010111010101011111111111011101111111110101010111110111111111110111111101011 1000001010101010001000001010000010101000000010100010000000000010101010100010001000000010000000001011 1011111011101111101011101011111110101111111010101110111011111110101010101011101011111010111111111011 1000001000100000101010100010000000101000100010000000100010000000001010001000100010000010001000000011 1111111110101011101010111110111111101010101110111111111110111111111010111110111110111110111011111111 1000000000101000101010100000100000001010001000001000100000100000100010100000001010001000100010000011 1011111111101110101010101111111011111011111111101010101111111011101111101111101011101111101110111011 1000100000100010001000100000001000001000000000101010001000000010001000001000101000101000001000001011 1110111110111011111110111111101111111111111010111011111110111010111010111010101011101011111011101011 1000100000100000100010001000100000000010001010001010000010001010100010100010101010001000001010101011 1011101110101111101011101011111111111010101111101011101011101010111110111110101010111111101010101011 1000101000101010001000000010001000001000100000101000001010001010000010000010000010000000101010101011 1010101111101010111111111110101011101011111110101111111010111011111011111011111111101110101010101011 1010101000101010001000001000101010001000001000100000001010001000001000001000000000100010101010101011 1110101010101011101010111011101010111011111011101111101010101011111111101111111011111010101010101111 1000100010000010001010100010000010100010001010100010100010101010000000100000001000001010101000100011 1011101111101110111010101110111110101110101010111010111111101110111110111111101111101011101111111011 1010001000101000100010100010100010101000101010100010001000001000100010000000101000101000001000000011 1011101010111011101110111011101010111011101010101110101010111011111011111110101010101111111011111011 1000101010000010001000001000001010000010101010101000101010001000000010000010001010001000000010000011 1110101011111110101111101111111011111110101010101110101111101111111011101111111011101010111111111011 1000101000100000101000101000001000001000001010100000100000100000001000100000000010001010000010001011 1011111110101110101010111011101111101111101010111111111110101010111110101111111010111011111010101011 1000001000101000101010000010001010001000100010000000100000101010100000101000100010001000001000101011 1011101011101011111011111110101010111010111110111011101111101010101111101010101111101110111111101011 1000100010101000000000001000101010001010100000001010001000001010100010000010101000101000100000001011 1110111110101111111111101011101011101010101111111010111011111011111011111111101010101011101111111011 1010100000101010000010001010001000100010100000100010001000001000001000100000001010001010001010000011 1010111110101010111011101011101011111110111110101111101111101111101110101111111011111010111010111111 1010000010100010001000101000101000001000100000100000100010101010001000101000100010001010100000001011 1011111010111011101110111110101110101011101111111110111010101010101011101010101110101110111111101011 1000100010001010001000100000100000101010101000000000100010001010101000001010100000100010100000100011 1010101111101010111011101111111110111010101011111110101111101010101111111010111111111010101110111011 1010101000101010101000001000100000100010001010001000101000100010100000001010000010001010001010100011 1010101010101010101111111110101111101011111010101111101010111110111111101010111010111010111010111011 1010100010100010100000000000101000101010001000100000000010000000100000001010001000100010000010001011 1011111110101110101111111011101010101110101111111011111111101111111011111011101111101111111110101011 1010000000100010101000001010001010101000101000001000001000101000001010001000100000100010000010101011 1010111111111110101011101010111010101011101011101111111010111011101110101110111110111010111011101011 1000000000000000100010001000000010100000100000100000000010000000100000100000000010000000100000001311 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 10 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1210000010000000000000001000000000000000100010000000100000001000000000000010001000000000000010000011 1011101010111111101111111010111111111110101011111010111110111010111011111110101010111111111011111011 1000101000100010100010000010100000000010001000001010000010000010100010000000100010000010001000001011 1110101111101010111010111110111011111011111111101011111011111110111110111111111110111011101111101011 1010101000001010100010100010001010001010000000101000001010000000100000000010000010100010001000100011 1010101111101010101110111011101011101010111011101011101010111111101111111110111011101110101010111011 1000100000001010100010001010001000001000100010001010101000100000001010000000101000101000100010001011 1011111111111010111011101010111111101111101110111010101110101111111010111111101110101011111111101011 1000100000001010001000000010000010100000101000100000101000101010000010100000000010001010100000001011 1110101111101010101111111011111010111110101011101111101111101010111010111111101111111010101111111011 1010001000001000101000001000100010000010100010001000100000001010100010100000100000000010001000000011 1011111011111111101011101011101111111010111111111010101111111010101110101110111011101111101011111111 1000001010000000101000101010001000000010000000000010100000100000100010101000001000101000101010000011 1011101011101110111110101010111010111011111111111110111110111111111010101111101110101010101011101011 1010100010001000100000101010001010101010100000100010001010001000100010101000101000101010101000101011 1010111110111011101111101011101110101010101010101011101011101010101110101010101111101010111110101011 1000100000101010100000101010001000101010001010101010001000101010101000101010100000001010000010001011 1110101111101010101110101010111011101010111010111010111010101010101011101010111111111011111011111011 1010001010001010100010101010100010100010100010000010001010100010101000100010000000000010001000100011 1011111010101010101110101110101010101110101111111011101010111110101110111111101111111110101110101111 1000001000100010001000101000101010001000101000100010001010000000100010100000101000000000100010000011 1010111011111110111011101011111010111111101010101110111111111110101010101110101011111111111111111011 1010100010000010001010101010000010000000001010001010100000000010101010001010100010001000100000001011 1010101110111011101010101010101111111111111011111010101111111010111011111010111110101010101111101111 1010101000101000001010100010100000100000001000100010001000100010100000000010000000100010000000100011 1110101011101111111010111111111110101111101110111011111011101110101111111011111111111111111110111011 1000101010001000000010000000000000101000101010100000100000101010100010000000000010000000000010001011 1011101011101011101111111110111110101011101010101111101110101010111011111111111010111111111011111011 1000101000001010001000000010100010101000101000001000101010001000100010000010000010100000000010000011 1010101111101011101011111010101010101110101011111010101011111011101010111011111110111111101110111011 1010100010101000101000100010101000100000101010000010001000001000001010101000000010000000100000101011 1010111010101110111110101110101111111110101010111111111111101110111110101111111010111110111111101011 1010000010001010000000101000101000000000101010001010000000100010100010100000001010000010001000001011 1011111110111011111111101010111011111111101111101010101110101110101010101111101011111110101110111011 1000100010001000000000101010001010100000100000001000101000101000101000100010001010000010100010000011 1110101011101011111011101011101010101110111011111011101011101011101111111011101010111010111011111111 1010101000001010001000101000101000101010001000001010001010001010001000001000101000101010100010000011 1010101111111010101110101111101110101011101111101110111011101010111110101110101111101011101110111011 1000100000100000100010100000100000101010001000101000101000100010100000100010100000001000101000001011 1011111110111111111110111110111111101010111010101011101110101110111011111010111111111110101011111011 1010000010000010000010000010001000001010100010101010000000100010100010000000100000000000101010100011 1010111111111010111011101011101011111010101111101010111111111010101110111111101111111111101010101011 1010000000001000101000101000101000000010100000001010001000000010100010001000101000100010100010101011 1010111111101111101110111010101111111010111111101011101111111110101011111010101010101010101110101111 1010000000100000000010100010100000000010001000101010000000000000101000100010001010101010100000100011 1011101111111011111010101110111111111111101010101011111111111111111110101111111010101010101111111011 1000101000001010001010001000001000000000100010101000001000000010000000100010000010001010001000001011 1110111011101010101111101111111011111110111110101011101011111010111111111010111111111010111011101011 1010000010101000100000001000000010000010000010101000100010000010100000001000100010100010001010101011 1011111110101011111011111011111110101111111010101111111110111110101111101111101010101111111010101011 1010000000101010001010000010001010100000001000100000000000100000101000100000101000100000000010100011 1010111110101010101110111110101010111011111111111111111111101111101010111010101110111111111110111111 1010001010001010100000100010101000001000100000001000000010100010001010100010001010100010000010000011 1011101011111010111111101010101111111010101011111010111010101010111010101111111010111010111010111111 1000100000101010001000001010100010001010001010001010001010001010100010101000100000000010101000100011 1110111110101011101111101010111010101111101010101011101011111010101111101010101111111110101111111011 1000100010100010100000101000101000100000101000100000101000001000001000100010101000000010001000001011 1010111010111010111110101111101111111110111011111111101111101111101010111110111011111011101011101011 1010001010001000100000100000100000100010001000100000001000101000101010000010001010001000100010001011 1011101011101110101111111110101011101011101110101111111110101010111011111010101010101110111110111011 1010001000100010101000000010101000001010001000101000000000101010001010100010101000100010100000100011 1011101011111010101011111010111111111010111111101011111110101011101010101110101111101110101111101011 1000101000001010100000100010000000001000000000001000001000101000101010101000100000101000101000001011 1110101010111011111111101110111111101111111111111111101111101010101010101011111110101010101011111011 1000101010001000100000101010100000100000000000100000001000101010100010001000001010001010100010001011 1011101011101110101110101010111011111110111110101110111010101110111110111111101011111010111110111011 1010101000100010100010001010001010000010101000100010100010100000100010000000100010001010000000100011 1010101111111010111011111011101010111010101011101010101110111110101011111110111011101011111011101111 1010100000001010000010000000100010101010001000101010101010100000101000001010001000001010001010001011 1010111111101011111111101111111010101010111110101011101010101111101111101011101111111010101010111011 1010000000101000100000001000000010101010100000101000100010001010001000101000100000001010100010100011 1010111110101010111110111011111110101011101111111110111011111010111010101010111111101010111110101011 1010000010001010000010001000101000100000001000000000001010000010100010101010000000100010100000101011 1010111111101011111011101110101011101111111111101111101010101010111010101110111110111011101111101011 1010100000101000101000101000101000101000000000100000101010101010001010100010100010001010001000001011 1011101110101110101110101011101110111011111110111110111011101011101010111010101010111010111010111111 1010001000101000100010001010000010100010001010101010000000001000100010001010001010100010100010100011 1010111011101011101111101010111010101110101010101011111111111011111011111011111110101110101110101011 1010001010001000100010001000101010101000100010001000000000100010000010001000000010000010100010001011 1011101010111010101010111111101010101011101111111111111110101110111110101111111011111010111110111011 1000001010001010101000100000000010001010001000001000100010101000001000100010001000100010100010001011 1011111011101110101111101111111111111010111011101010101010111011111011111010101010101110101011111011 1010000010100000100010001000000010100010001000100010101000100010100010000000101010101000101000000011 1010111110111011111110111011101010101011111110111110101111101110101111111111101110101011101111111011 1010001000001010000000101010101000101000000010000010100000001000100010001000000000101000101000001011 1111101111101010111111101010101111101111101110111110111111111010111010101111111111111110101011101111 1000001000100010100000000010100000000000101000100000001000100010001010101000100000000000100000100011 1011101010111110101111111010111111111111101011101111101010101111101010101010101111111111111110111011 1010001010000010101000001000001000100000100000101000100010101000101000100010100010000010000010100011 1011111011111010101011101111101010101110101111101011111110111010101111111110111011111010101010101011 1000100010001000101000100000101010001010100010001000001010000010001000001000100010001000101010101011 1110101110101111101110111110111011111010111110111010101011111111101111101010101110101111101010101011 1000100010100000100010100010001010100010001000101010100000001000100000001010100000101000001010101011 1011111011101110111110111011101010101011101011101010101111111010111111101011111111101011111010101011 1010001010001010100010001000101010001000101010001010101000100010000000101000001000101000001010101011 1010101010111010101011101011101010111011101010101010111010101111101111101111101010101111101011101011 1000100000100000001000001000000010001000000010100010000010000000100000000000100010000000001000001311 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
一、递归方式解决,代码如下
#include<stdio.h> int search(int startI,int startJ,int endI,int endJ); char maze[100][101]; int success=0; void main() { int L; //freopen("maze2_test.txt","r",stdin); for(L=0;L<10;L++) { int i,j; int T=0; int result; int startI=0,startJ=0; int endI=0,endJ=0; scanf("%d",&T); for(i=0;i<100;i++) scanf("%s",maze[i]); for(i=0;i<100;i++) for(j=0;j<100;j++) { if(maze[i][j]==‘2‘) { startI=i; startJ=j; } if(maze[i][j]==‘3‘) { endI=i; endJ=j; } } success=0; result=search(startI,startJ,endI,endJ); printf("#%d %d\n",T,result); /*for(i=0;i<16;i++) { printf("%s",maze[i]); printf("\n"); }*/ } } int search(int startI,int startJ,int endI,int endJ) { if(maze[startI][startJ]==‘3‘) success=1; maze[startI][startJ]=‘1‘; if(success==0&&maze[startI+1][startJ]!=‘1‘&&maze[startI+1][startJ]!=‘2‘) search(startI+1,startJ,endI,endJ); if(success==0&&maze[startI][startJ+1]!=‘1‘&&maze[startI+1][startJ]!=‘2‘) search(startI,startJ+1,endI,endJ); if(success==0&&maze[startI-1][startJ]!=‘1‘&&maze[startI+1][startJ]!=‘2‘) search(startI-1,startJ,endI,endJ); if(success==0&&maze[startI][startJ-1]!=‘1‘&&maze[startI+1][startJ]!=‘2‘) search(startI,startJ-1,endI,endJ); if(success==0) maze[startI][startJ]=‘0‘; return success; }
二、利用队列来解决,代码如下
#include<stdio.h> typedef struct node { int x; int y; }Node; void push(Node shu[10000],Node n); Node pop(Node shu[10000]); int empty(Node shu[10000]); int front=-1; int rear=-1; void main() { int L,T; freopen("maze2_test_input.txt","r",stdin); //freopen("test.txt","r",stdin); for(L=0;L<10;L++) { int i,j; int result=0; front=-1; rear=-1; Node shu[10000]; Node n; char maze[100][101]; scanf("%d",&T); for(i=0;i<100;i++) scanf("%s",maze[i]); for(i=0;i<100;i++) { for(j=0;j<100;j++) if(maze[i][j]==‘2‘) { n.x=i; n.y=j; push(shu,n); } } while(1) { if(!empty(shu)) { n=pop(shu); Node n1,n2,n3,n4; if(maze[n.x][n.y]==‘3‘) { result=1; break; } maze[n.x][n.y]=‘1‘; if(maze[n.x+1][n.y]!=‘1‘&&maze[n.x+1][n.y]!=‘2‘) { n1.x=n.x+1; n1.y=n.y; push(shu,n1); //printf("(%d,%d) ",n1.x,n1.y); } if(maze[n.x-1][n.y]!=‘1‘&&maze[n.x-1][n.y]!=‘2‘) { n2.x=n.x-1; n2.y=n.y; push(shu,n2); //printf("(%d,%d) ",n2.x,n2.y); } if(maze[n.x][n.y+1]!=‘1‘&&maze[n.x][n.y+1]!=‘2‘) { n3.x=n.x; n3.y=n.y+1; push(shu,n3); //printf("(%d,%d) ",n3.x,n3.y); } if(maze[n.x][n.y-1]!=‘1‘&&maze[n.x][n.y-1]!=‘2‘) { n4.x=n.x; n4.y=n.y-1; push(shu,n4); // printf("(%d,%d) ",n4.x,n4.y); } } else { result=0; break; } } printf("#%d %d\n",T,result); //printf("%d,%d\n",n.x,n.y); } } void push(Node shu[10000],Node n) { rear++; shu[rear].x=n.x; shu[rear].y=n.y; } Node pop(Node shu[10000]) { Node n; if(!empty(shu)) { front++; n.x=shu[front].x; n.y=shu[front].y; } return n; } int empty(Node shu[10000]) { if(front==rear) return 1; return 0; }