a_1, a_2, a_nb_1, b_2, b_n2n positive numbers. We know that all the a_i1 n are not equal, and that they can be separated into two partitions of equal sum. These two properties hold for the b_i1 n, as well. Prove that there exists a simple 2n-gon with sides parallel to the coordinate axes such that the lengths of its horizontal edges are equal to a_i's and the lengths of its vertical edges are equal to b_i$'s (a simple polygon is one that does not cross itself).
Solution
We start with a lemma.
Lemma 1. Suppose that are given two sequences and of positive real numbers as lengths of segments. We start from the origin and at the step (), we go up with a segment of length and then we go right with a segment of length . Suppose that is the line connecting origin to the endpoint of the last segment. Show that all segments lie in the top of line .
Proof. Assume to the contrary that there is a first segment which intersects , say . Obviously, is a horizontal segment because if it was vertical, it could not be the first segment intersecting . Suppose that . We denote by and the origin and the endpoint of the segment , respectively. Since lies below the line , we get that the slope of is less than the slope of .
or equivalently
Note that since 's are increasing we have
This implies that the right hand side of is less than . Similar arguments show that the left hand side of is greater than (note that 's assumed to be decreasing). This contradiction established the lemma.
For the main problem suppose that we have divided both 's and 's into two sets having equal sums.
* such that , where .
* such that , where .
There is no loss of generality in assuming that . We will use the following algorithm for constructing the polygon.
* We start from the origin ( is the origin).
* For , at the -th step, we start from , then we go up in a segment of length to get and then right in a segment of length to get .
* For , at the -th step, we start from , then we go down in a segment of length to get and then left in a segment of length to get .
Note that since the lengths of 's and 's are assumed to be monotone, according to the lemma, first sides of polygon lie in the top of the segment and the next sides lie in the bottom of .
* For , at the -th step, we start from , then we go down in a segment of length to get and then left in a segment of length to get .
Again because of the lemma, all these sides lie in the bottom of the segment .

Because and , we return to the origin at the end of the algorithm and so we get a polygon. Now it suffices to prove that this polygon is simple.
Obviously, in each part of algorithm the segments can not intersect each other. On the other hand, according to the lemma, two segments from two different parts of algorithm can intersect only if the segment connecting the first and the last vertex of each part lie on the same line. But this is possible only if (it means that there is not any side in the second part of algorithm). In this case we have intersection on the connecting line only if there are some and , such that
Since and , from (1) we get
So . Similar arguments for 's instead of 's imply . Therefore, . Thus, all inequities in (3) are equalities. So
Therefore, (say this common value ) and similarly, (say this common value ). Now since , we have . In the same manner, (say this common value ), (say this common value ) and . But since and , we have . Hence, and . It means that all the horizontal segments have equal lengths and all the vertical segments have equal lengths, which contradicts problem conditions.