Quiz_2

While playing with a long piece of lumber, it accidentally broke into several pieces. To reuse this lumber, you plan to reinforce it by attaching thin strips of wood over the broken points. Unfortunately, the thin strip of wood, which was originally the same length as the lumber, also shattered into several pieces while being carried. You want to join these lumber pieces and thin wood strips together, but the rule is that the area around each break point in the lumber must be covered by at least a length of D by the thin wood strip.
For example, suppose the lumber broke into 5 pieces with lengths (88.554695, 70.20813, 58.299934, 99.252353, 55.450232) in order, the thin wood broke into 11 pieces with lengths (41.174523, 32.644077, 27.107224, 46.148522, 25.782222, 30.377803, 41.896296, 33.606177, 28.4785, 23.508608, 41.041391), and the required safety length D is 20 (meaning a thin wood piece of at least length 20 must cover each break point). As shown in the figure, arranging the wood pieces in the given order makes the lumber usable again.
Given an arbitrary array of positive real numbers as lumber piece lengths, another array of positive real numbers as thin wood piece lengths, and a safety length D that is smaller than the shortest lumber piece length, how can you arrange the thin wood pieces to reinforce the lumber?
You accidentally broke a piece of lumber wood into a few smaller pieces while playing with it. In order to get these pieces back into its original shape, you try to glue a layer of thin piece of wood over, but you accidentally broke the thin layer of wood into a few pieces while carrying it. You have to glue those pieces of lumber wood and thin wood, but to make it strong enough, you have to make sure that broken points of lumber wood and broken points of thin wood don't overlap(which means, distances between broken points are at least D/2, where D is given length).
For example, you have length (88.554695, 70.20813, 58.299934, 99.252353, 55.450232) of lumber wood pieces(in order), length (41.174523, 32.644077, 27.107224, 46.148522, 25.782222, 30.377803, 41.896296, 33.606177, 28.4785, 23.508608, 41.041391) of thin wood pieces, and given length D is 20(which means, piece of thin wood longer than 20 is required to cover a single broken point of lumber wood), by glueing pieces of wood in given order(shown in picture) will work.
Find a way to glue the pieces of wood with given array of positive real numbers as lengths of lumber wood pieces, another array of positive real numbers as lengths of thin wood pieces, and safety length limit D(which is bigger than half of shortest length of lumber wood piece).