{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eMaomao\u0027s candies were taken away by Dudu. Now Maomao wants to grab Dudu and bring the candies back.\u003c/p\u003e\n\u003cp\u003eNow they are in a rectangular area with $n$ rows and $m$ columns. The coordinates of the top left corner of the area are $(1,1)$, and the co-ordinates of the bottom right corner of the grid are $(n,m)$. Give the coordinates of the location where Maomao and Dudu were origi-nally located, they take turns to act and Dudu acted first. When it is Dudu\u0027s turn, Dudu will move to the adjacent grid. At the same time, he will eat some candy. The number of candy Dudu eats satisfies the following formula:\u003c/p\u003e\n\u003cp\u003e$$a_i\u003d\\frac{[(\\frac{1+\\sqrt{5}}{2})^i-(\\frac{1-\\sqrt{5}}{2})^i]}{\\sqrt{5}}$$\u003c/p\u003e\n\u003cp\u003emeans that if it is his $i$-th actions, he will eat $a_i$ candies. When it is Maomao\u0027s turn, if Dudu\u0027s location is adjacent to or coincide with hers, she will catch Dudu and take back all her candies. Otherwise she will move to adjacent grid. Both Dudu and Maomao can not stand still in his(her) turn, which means they must move in their turns, and the adjacent grids of grid $(i, j)$ are grid $(i-1, j)$, $(i+1, j)$, $(i, j+1)$ and $(i, j-1)$. They can not move outside the rectangular area. To eat candies as many as possible, Dudu wants to take more actions. While Maomao wants to get her candies back and get the least loss, so she will take actions with the strategy which can catch Dudu as soon as possible. Please calculate how many candies will Dudu eat before he is caught by Maomao.\u003c/p\u003e\n\u003ch2\u003eInput\u003c/h2\u003e\n\u003cp\u003eThe first line an integer $T$, means $T$ cases. ($1 \\le T \\le 10^5$)\u003c/p\u003e\n\u003cp\u003eFor each case, input one line with 6 numbers $n$, $m$, $r_1$, $c_1$, $r_2$, $c_2$, means that the rectangle has $n$ rows and $m$ columns, and Maomao\u0027s initial location is $(r_1,c_1)$, Dudu\u0027s initial location is $(r_2,c_2)$. ($1 \\le r_1,r_2 \\le n \\le 10^9$, $1 \\le c_1,c_2 \\le m \\le 10^9$)\u003c/p\u003e\n\u003cp\u003eTheir initial locations are distinct.\u003c/p\u003e\n\u003ch2\u003eOutput\u003c/h2\u003e\n\u003cp\u003eFor each data, if it\u0027s impossible for Maomao to catch Dudu, please output \"countless\". Otherwise output the number of candies Dudu will eat before he is caught by Maomao. Since the number will be very large, you should output the answer mod $1025436931$.\u003c/p\u003e"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\n1 2 1 1 1 2\n3 3 1 1 3 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n4\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr /\u003e"}}]}