A square is inscribed in a right triangle with legs x and y and has common right angle with the triangle. The perimeter of the square is given by
1
\(\frac{2xy}{x+y}\)
2
\(\frac{4xy}{x+y}\)
3
\(\frac{2xy}{\sqrt{x^2+y^2}}\)
4
\(\frac{4xy}{\sqrt{x^2+y^2}}\)