{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cbr\u003eAn artist Kalevich is very ambitious and he has many different achievements over the years of his work. Kalevich became extremely famous when he first produced the largest digital picture in the world, setting a new world record in digital painting. It was a great victory with a very unusual image\u0026nbsp;— a billion pixels in width, and... only one pixel in height. The win changed the entire Kalevich\u0027s life, so starting from that memorable moment all his digital masterpieces have the height of 1 pixel.\u003cbr\u003eRecently Kalevich was invited to an exhibition in order to demonstrate the best picture he has ever painted. The picture is \u003ci\u003en\u003c/i\u003e pixels in width, 1 pixel in height, and it is called \"The Monochrome Snake\". As you have already guessed, the painting is indeed monochrome, so the \u003ci\u003ei\u003c/i\u003e-th pixel is characterized by a single integer \u003ci\u003ec\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e from 0 to 10\u003csup\u003e6\u003c/sup\u003e that is a grayscale representation of its color.\u003cbr\u003eMany visitors at the exhibition have never seen any pictures with colors different from the standard 24-bit RGB, so they look at Kalevich\u0027s masterpiece with a great suspicion. Kalevich realized that the visitors do not like monochrome pictures at all, and what is even worse, if the colors of two adjacent pixels in a monochrome picture differ exactly by one, the visitors get angry and go away. Kalevich feels really nervous about this, so he wants to improve his painting in order to please the exigent visitors and keep them at the exhibition. At the same time he wants to preserve the idea of the picture — the snake should be still recognizable, so the only change he wants to make is to delete some pixels here and there. When he deletes a pixel, the width of the painting decreases by 1 of course. Kalevich will be satisfied with the result if |r\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e-\u003ci\u003er\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e+1\u003c/sub\u003e| ≠q 1 for all \u003ci\u003ei\u003c/i\u003e\u003d1... \u003ci\u003em\u003c/i\u003e-1, where \u003ci\u003er\u003c/i\u003e is the final masterpiece and \u003ci\u003em\u003c/i\u003e is its length.\u003cbr\u003eYour task is to help Kalevich and write a program that will help him to delete the minimum number of pixels from the picture, so that the resulting masterpiece does not have any two adjacent pixels with the colors that differ exactly by one.\u003cbr\u003e\u003cdiv align\u003d\"left\" style\u003d\"margin-top: 1.0em;\"\u003e\u003cb\u003eInput\u003c/b\u003e\u003c/div\u003eThe first line of input contains a single integer \u003ci\u003en\u003c/i\u003e (1 ≤ \u003ci\u003en\u003c/i\u003e ≤ 10\u003csup\u003e5\u003c/sup\u003e). The second line of input contains \u003ci\u003en\u003c/i\u003e integers separated by spaces\u0026nbsp;— pixel colors \u003ci\u003ec\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e, \u003ci\u003ec\u003c/i\u003e\u003csub\u003e2\u003c/sub\u003e,..., \u003ci\u003ec\u003c/i\u003e\u003csub\u003e\u003ci\u003en\u003c/i\u003e\u003c/sub\u003e (0 ≤ \u003ci\u003ec\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e ≤ 10\u003csup\u003e6\u003c/sup\u003e).\u003cbr\u003e\u003cdiv align\u003d\"left\" style\u003d\"margin-top: 1.0em;\"\u003e\u003cb\u003eOutput\u003c/b\u003e\u003c/div\u003eTo the first line of output print the minimum number of pixel deletions \u003ci\u003et\u003c/i\u003e that are needed to satisfy Kalevich\u0027s requirements. To the second line print \u003ci\u003em\u003c/i\u003e integer numbers (\u003ci\u003em\u003c/i\u003e \u003d \u003ci\u003en\u003c/i\u003e-\u003ci\u003et\u003c/i\u003e) \u0026nbsp;— the masterpiece that is left after \u003ci\u003et\u003c/i\u003e pixel deletions. \u003cbr\u003eIf there are many solutions, you may output any of them.\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\u003e6\n4 2 2 1 1 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n4 1 1 1 \u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Sample 2","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\u003e5\n1 2 3 2 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n1 3 1 \u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}