Using the quadratic formula we find that \(\bar{X}=1.49\) which means that to insure that agents in the first group get U=0.5, it is necessary to redistribute .49 units of X to their benefit.
Hence the relative price is equal to:
\(\frac{P_Y}{P_X} = \frac{4+\bar{X}}{7} \approx 0.784\)
We can now calculate the quantities consumed by first kind of agent using the demand curves:
 \(X=0.5\bar{X}+0.5\frac{P_Y}{P_X} \approx 1.137\)
\(Y=0.5+0.5\bar{X}\frac{P_X}{P_Y} \approx 1.145\)
This leaves the second kind of agents with 0.863 units of X and 0.55 units of Y, with a utility level of -0.893.