【题目描述】
Somewhere deep in the Czech Technical University buildings, there are laboratories for examining mechanical and electrical properties of various materials. In one of yesterday’s presentations, you have seen how was one of the laboratories changed into a new multimedia lab. But there are still others, serving to their original purposes.
在捷克技术大学大楼的深处,有实验室用来检查各种材料的机械和电气性能。在昨天的一次演示中,您已经看到了一个实验室是如何变成一个新的多媒体实验室的。但还有其他实验室,服务于它们的原始目的。
In this task, you are to write software for a robot that handles samples in such a laboratory. Imagine there are material samples lined up on a running belt. The samples have different heights, which may cause troubles to the next processing unit. To eliminate such troubles, we need to sort the samples by their height into the ascending order.
在这项任务中,你要为一个在实验室处理样本的机器人编写软件。想象一下,跑道上有一些材料样本排列在一起。样品具有不同的高度,这可能会给下一个处理单元带来麻烦。为了消除这种麻烦,我们需要把样品按高度分类成升序。
Reordering is done by a mechanical robot arm, which is able to pick up any number of consecutive samples and turn them round, such that their mutual order is reversed. In other words, one robot operation can reverse the order of samples on positions between A and B.
重新排序由机械机械手臂完成,机械手臂能够拾取任