{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":" There are \u003ci\u003en\u003c/i\u003e chameleons moving along a circle of length \u003ci\u003eL\u003c/i\u003e with speed 1, each moving either clockwise or counter-clockwise. \u003ci\u003ei\u003c/i\u003e-th chameleon is initially located at point \u003ci\u003ep\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e and has color \u003ci\u003ec\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e, which is represented by an integer number.\u003cbr\u003eWhen two chameleons meet, the following happens: \u003cli\u003eThe one that was traveling counter-clockwise changes color to the color of the clockwise one. \u003c/li\u003e\u003cli\u003eThey turn around, so the one that was traveling counter-clockwise now travels clockwise, and vice versa. \u003cbr\u003eIt\u0027s not so difficult to figure out that the ordering of chameleons among the circle always stays the same, and it is impossible for more than two chameleons to meet at the same point.\u003cbr\u003eWhat will be the locations and colors of all chameleons at time \u003ci\u003eT\u003c/i\u003e (the input data describes time 0)?\u003cbr\u003e\u003cdiv align\u003d\"left\" style\u003d\"margin-top: 1.0em;\"\u003e\u003cb\u003eInput\u003c/b\u003e\u003c/div\u003eThe first line of the input file contains an integer \u003ci\u003en\u003c/i\u003e, \u003cimg src\u003d\"CDN_BASE_URL/fb85766c999ac7c8cbbe553a490316b1?v\u003d1715425370\" style\u003d\"vertical-align: text-bottom;top: -2.0px;max-width: 100.0%;max-height: 100.0%;\"\u003e. The second line contains an integer \u003ci\u003eL\u003c/i\u003e, 1 ≤ \u003ci\u003eL\u003c/i\u003e ≤ 10\u003csup\u003e9\u003c/sup\u003e. The next \u003ci\u003en\u003c/i\u003e lines contain 3 integers each, \u003ci\u003ep\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e, \u003ci\u003ec\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e, \u003ci\u003ed\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e\u0026nbsp;— the location, color and direction of \u003ci\u003ei\u003c/i\u003e-th chameleon, 0 ≤ \u003ci\u003ep\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e \u0026lt; \u003ci\u003eL\u003c/i\u003e, 1 ≤ \u003ci\u003ec\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e ≤ 10\u003csup\u003e9\u003c/sup\u003e, \u003ci\u003ed\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e is either -1 or 1. The last line contains an integer \u003ci\u003eT\u003c/i\u003e, 0 ≤ \u003ci\u003eT\u003c/i\u003e ≤ 10\u003csup\u003e18\u003c/sup\u003e.\u003cbr\u003eThe coordinate system is chosen in such a way that increasing one\u0027s coordinate means moving clockwise, and points on the circle have coordinates between 0 (inclusive) and \u003ci\u003eL\u003c/i\u003e (exclusive). \u003ci\u003ed\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e can take one of two values: 1 for moving clockwise, and -1 for moving counter-clockwise.\u003cbr\u003eAll \u003ci\u003ep\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e are different.\u003cbr\u003e\u003cdiv align\u003d\"left\" style\u003d\"margin-top: 1.0em;\"\u003e\u003cb\u003eOutput\u003c/b\u003e\u003c/div\u003eOutput \u003ci\u003en\u003c/i\u003e lines with 3 numbers each, one floating-point (location) and two integers (color and direction), having the same meaning as the input numbers, but describing time \u003ci\u003eT\u003c/i\u003e. The chameleons should be described in the same order as in the input file. It is guaranteed that no chameleons will meet at exactly \u003ci\u003eT\u003c/i\u003e. Your answer will be accepted when each number is within 10\u003csup\u003e-9\u003c/sup\u003e relative or absolute error of the correct answer. Please note that the coordinate you output should always be more than or equal to 0 and strictly less than \u003ci\u003eL\u003c/i\u003e. Your answer will not be accepted when you output a coordinate very close to \u003ci\u003eL\u003c/i\u003e but the correct answer is 0.\u003cbr\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\u003e4\n13\n2 1 1\n0 2 -1\n12 3 1\n5 2 1\n23\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2.000 2 1\n12.000 1 1\n9.000 3 1\n3.000 3 -1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}