Help me to solve a problem with rectangles. I cannot resize rectangles and save proportions. I have two rectangles with different sizes. I need to resize second rectangle to fit proportions of a first one. 
First rectangle :


*

*w1:350

*h1:150  

*S1:150*350=52500

*propotion1:350/150=2,333


Second rectangle:


*

*w2:500

*h2:430

*S2:500*430=215000 

*propotion2:500/430=1,16


i need to find w3 and h3 of third rectangle so S2=S3 and proportions w1/h1=w3/h3 should be same (2,3 like for a first rectangle).
But i cannot get it how to do this.
Result of equations should be something near
w3=730
h3=300 but this is quess actually. How to find those w3 and h3?
Calculator gives me a numbers but still i dont get it. How he actually found it:

 A: you gave $w_{1}/h_{1} = 7/3= w_{3}/h_{3} $
$S_{2} = S_{3} = 215000 $
So
$S_{3} = w_{3} * h_{3} $
as ratio is 7/3 , so some factor mutiplied by 7 is w3 and same factor multiplied by 3 is h3 . let that factor be x
$215000 = 7x * 3x $
$x^2 = 10238.09 $
$ x = 101.183 $ 
so
$w_{3} = 7*x = 708.28 $
$h_{3} = 3*x = 303.549 $
And your guess is wrong as it is not equal to 215000. your guess gives answer 219000.

As you stated in comments for program, procedure to find w3 and h3 is
  as follows
step1 : find 350/150 = 2.3333
step2 : divide  215000 by 2.333 
step3 : find square root of the value in step 2 . which is the factor
  x = 303.57
step4 : w3 = 2.333 * 303.57 , h3 = 303.57
apply above in a program to get the desired w3 and h3

A: Given a desired area, $S3,$ and a desired proportion $p=\frac {w3}{h3}$, we have $h3=p*w3, S3=w3*h3=p*(w3)^2$ so $w3=\sqrt{\frac {S3}p}, h3=\sqrt{p*S3}$  You need to make sure you are using floating point numbers instead of integers, or $p$ will get truncated to an integer.
