{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003ctable width\u003d\"100%\"\u003e\n \u003ctbody\u003e\n \u003ctr valign\u003d\"top\"\u003e\n \u003ctd width\u003d\"100%\"\u003e\u003cp\u003eRocket Mania is one of my favourite games of Fantasy Games series. In the game, there are matches on the left hand side, and rockets on the right hand side. In between, there are different sorts of fuse blocks (See Figure A). These fuses can be rotated 0, 90, 180 or 270 degrees. To launch a rocket, you must form an unbroken path of fuses from the match to the rocket. When a fuse is complete, all rockets linked to a match will launch (See Figure B).\u003c/p\u003e\u003cp\u003eYour task is, given an initial situation, rotate some fuse blocks to make as many rockets launch as possible by firing one specified match.\u003c/p\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cimg src\u003d\"CDN_BASE_URL/876c1315102e9447ebf85cb2f841518f?v\u003d1679152349\" width\u003d\"240\" height\u003d\"180\"\u003e\u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n\u003c/table\u003e\n\u003ctable width\u003d\"100%\"\u003e\n \u003ctbody\u003e\n \u003ctr align\u003d\"center\"\u003e\n \u003ctd\u003e\u003cimg src\u003d\"CDN_BASE_URL/a54aa57a606cdd5aa8ed105c7242641d?v\u003d1679152349\" width\u003d\"180\" height\u003d\"227\"\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cimg src\u003d\"CDN_BASE_URL/ac879ff908a5812828ebd03094afdf7b?v\u003d1679152349\" width\u003d\"180\" height\u003d\"227\"\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cimg src\u003d\"CDN_BASE_URL/29676a79b9a5a4a46f4641c33e631b80?v\u003d1679152349\" width\u003d\"168\" height\u003d\"125\"\u003e\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd align\u003d\"center\"\u003eFigure A\u003c/td\u003e\n \u003ctd align\u003d\"center\"\u003eFigure B\u003c/td\u003e\n \u003ctd align\u003d\"center\"\u003eFuse Pipes\u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n\u003c/table\u003e\n\u003cp\u003e\u003cstrong\u003eInput\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eInput contains multiple test cases. Each test case starts with a number X (1 \u0026lt;\u003d X \u0026lt;\u003d 9), which specifies the position of the match you can fire. Then followed by 9 lines, each line consists of 6 characters. The characters may be \u0027.\u0027, \u0027-\u0027, \u0027L\u0027, \u0027T\u0027 or \u0027+\u0027, which specify an empty block or a corresponding type of fuse block.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eOutput\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThere is one line for each test case, which is the maximum number of rockets you can make launch by firing the match on the X\u0027th row. If no rockets can launch, just output 0.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eSample Input\u003c/strong\u003e\u003c/p\u003e\n\u003cpre\u003e1\nLLLLLL\nLLLLLL\nLLLLLL\nLLLLLL\nLLLLLL\nLLLLLL\nLLLLLL\nLLLLLL\nLLLLLL\n3\n......\n.L----\n-+----\n.-....\n.T---L\n.L----\n......\n......\n......\n5\n-L-L-L\n-TL--T\n-L-T-L\n--+---\n---T--\n-TL---\n---LT-\n---T-T\n-TL-T-\n1\nTTTTTT\nTTTTTT\nTTTTTT\nTTTTTT\nTTTTTT\nTTTTTT\nTTTTTT\nTTTTTT\nTTTTTT\n\u003c/pre\u003e\n\u003cp\u003e\u003cstrong\u003eSample Output\u003c/strong\u003e\u003c/p\u003e\n\u003cpre\u003e1\n3\n4\n9\n\u003c/pre\u003e\n\u003cp\u003e\u003cstrong\u003eHint\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThe time limit has been set to 3 times of the time the standard solution requires.\u003c/p\u003e\n\u003chr\u003e\u003cstrong\u003eHomepage:\u003c/strong\u003e \u003ca href\u003d\"http://fairyair.yeah.net/\" target\u003d\"_blank\"\u003ehttp://fairyair.yeah.net/\u003c/a\u003e \u003cbr\u003e\n\u003cp\u003eWhere is my soul floating? Where is the end? Before the finality of sinking into the sea of chaos, what shall I adhere to to continue this journey? Aimlessly roving in this lonesome and listless world, I wish the power of changing the world. I pour the whole of my volition, agglomerating into a ghost of a power with a light light light of hope, which has been all my power and established Fairyair -- http://fairyair.yeah.net/\u003c/p\u003e"}}]}