Dividing a unit square into rectangles I've been given this task: 

A unit square is cut into rectangles. Each of them is coloured by either yellow or blue and inside it a number is written. If the color of the rectangle is blue then its number is equal to rectangle’s width divided by its height. If the color is yellow, the number is rectangle’s height divided by its width. Let $x$ be the sum of the numbers in all rectangles. Assuming the blue area is equal to the yellow one, what is the smallest possible $x$?

I've came with the solution below:  I've simply split the unit square in half and assigned the colors. The reasoning behind that is that I want to have the blue side as high as possible (to make the $x$ as low as possible) and the yellow side as wide as possible (for the same reason). I didn't divide the square into rectangles with infinitely small height or width, because no matter how small they are, they eventually add up and form the two big rectangles that are on my picture.
I feel my solution is wrong though, because it is stupidly easy (you have to admit, that often means it's wrong). Is there anything I'm missing here?
 

Here is the full solution. The answer is, indeed, $5/2$. An example was already presented by the OP. Now we need to prove the inequality.
First of all we notice that for any color (blue or yellow) the sum of height/width (or width/height) ratios is always at least $1/2$.
Indeed, since all dimensions do not exceed $1$, we have (e.g., for blue color)
$$
\sum \frac{w_i}{h_i} \geqslant \sum w_i h_i = \frac 12 \,.
$$
as the final sum is the total area of all blue rectangles.
Second, we observe that either the blue rectangles connect the left and the right sides of the square, or the yellow rectangles connect the top and the bottom sides. We leave that as an exercise for the readers :) (Actually, as you will see below, it would suffice to show that either the sum of all blue widths or the sum of all yellow heights is at least $1$.)
Without loss of generality, assume that the blue rectangles connect the lateral sides of the large square. Then we intend to prove that
$$
\sum \frac{w_i}{h_i} \geqslant 2 \,,
$$
where the summation is done over the blue squares. Combining that with the inequality $\sum h_i/w_i \geqslant 1/2$ for the yellow squares we will have the required result, namely that the overall sum is always at least $5/2$.
Since the projections of the blue squares onto the bottom side must cover it completely, we have $\sum w_i \geqslant 1$. We also have $\sum w_ih_i = 1/2$. Now all we need is the following fact.
Lemma. Two finite sequences of positive numbers $\{w_i\}$ and $\{h_i\}$, i = $1$, ... , $n$ are such that
$$
\sum w_i = W, \qquad \sum w_ih_i = S \,.
$$
Then
$$
\sum \frac{w_i}{h_i} \geqslant \frac{W^2}S \,.
$$
Proof. We will use the well-known Jensen's inequality (which follows from the geometric convexity of the area above the graph of any convex function) for function $f(x) = 1/x$. That gives us
$$
\sum \frac{w_i}W f(h_i) \geqslant f \left( \sum \frac{w_i}W h_i \right) \,.
$$
In other words
$$
\frac1W \sum \frac{w_i}{h_i} \geqslant \frac1{\sum \frac{w_i}W h_i } = 
\frac{W}{\sum w_i h_i} = \frac WS \,.
$$
and the required inequality immediately follows. $\square$
Applying this lemma to our case where $W \geqslant 1$ and $S = 1/2$ completes our solution.
