{"trustable":false,"sections":[{"title":"","value":{"format":"PLAIN","content":"A research laboratory of a world-leading automobile company has received an order to create a special transmission mechanism, which allows for incredibly efficient kickdown , an operation of switching to lower gear. After several months of research engineers found that the most efficient solution requires special gears with teeth and cavities placed non-uniformly. They calculated the optimal flanks of the gears. Now they want to perform some experiments to prove their findings.\nThe first phase of the experiment is done with planar toothed sections, not round-shaped gears. A section of length n consists of n units. The unit is either a cavity of height h or a tooth of height 2h.Two sections are required for the experiment: one to emulate master gear (with teeth at the bottom)and one for the driven gear (with teeth at the top).\nThere is a long stripe of width 3 h in the laboratory and its length is enough for cutting two engaged sections together. The sections are irregular but they may still be put together if shifted along each other.\nThe stripe is made of an expensive alloy, so the engineers want to use as little of it as possible. You need to find the minimal length of the stripe which is enough for cutting both sections simultaneously.\nInput\nThe input file contains several test cases, each of them as described below.\nThere are two lines in the input, each contains a string to describe a section. The first line describes master section (teeth at the bottom) and the second line describes driven section (teeth at the top).Each character in a string represents one section unit , 1 for a cavity and 2 for a tooth. The sectionscan not be flipped or rotated.Each string is non-empty and its length does not exceed 100.\nOutput\nFor each test case, write to the output a line containing a single integer number , the minimal lengthof the stripe required to cut off given sections.\n\nSample Input\n2112112112\n2212112\n12121212\n21212121\n2211221122\n21212\nSample Output\n10\n8\n15"}},{"title":"","value":{"format":"PLAIN","content":"一家世界领先的汽车公司的研究实验室接到了一项订单,要求制造一种特殊的传动机构,它可以实现令人难以置信的高效减速,即切换到低档的操作。经过几个月的研究,工程师们发现,最有效的解决方案需要特殊的齿轮,这些齿轮的齿和齿腔的位置不均匀。他们计算出了齿轮的最佳侧面。现在他们想进行一些实验来证明他们的发现。\n实验的第一阶段是用平面齿形截面,而不是圆型齿轮来做的。一个长度为n的截面由n个单元组成。单位是高度为h的空腔或高度为2h的齿.实验需要两个截面:一个用来模拟主齿轮(齿在底部),一个用来模拟从动齿轮(齿在顶部)。\n实验室里有一条宽度为3h的长条,其长度足以将两个啮合的部分切割在一起。这些部分是不规则的,但如果沿着彼此移动,它们仍然可以组合在一起。\n该条带是由一种昂贵的合金制成的,所以工程师希望尽可能少地使用它。您需要找到足够同时切割两个部分的最小长度的条纹。\n輸入\n输入文件包含几个测试用例,每个测试用例的描述如下。\n输入文件中有两行,每行包含一个字符串来描述一个截面。第一行描述主断面(齿在底部),第二行描述驱动断面(齿在顶部)。每個字串是非空的,其長度不超過100。\n輸出結果\n对于每个测试案例,在输出中写入一行包含一个整数,即切断给定部分所需的最小条带长度。\n\n输入示例\n2112112112\n2212112\n12121212\n21212121\n2211221122\n21212\n采样输出\n10\n8\n15"}}]}