Problem:
Score : 100 points

Problem Statement

In an electric circuit, when two resistors R_1 and R_2 are connected in parallel, the equivalent resistance R_3 can be derived from the following formula:

\frac{1}{R_1} + \frac{1}{R_2} = \frac{1}{R_3}

Given R_1 and R_2, find R_3.

Constraints

1 \leq R_1, R_2 \leq 100

R_1 and R_2 are integers.

Input

The input is given from Standard Input in the following format:

R_1 R_2

Output

Print the value of R_3.

The output is considered correct if the absolute or relative error is at most 10^{-6}.

Sample Input 1

2 3

Sample Output 1

1.2000000000

Sample Input 2

100 99

Sample Output 2

49.7487437186

Solution in C# (Mono 4.6.2.0) (judge verdict: Accepted)

//#pragma warning disable
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System;
using System.Numerics;
using System.Threading.Tasks;
using static System.Math;
using static System.Console;
class E { static void Main() => new K(); }
class K
{
	int F() => int.Parse(ReadLine());
	long FL() => int.Parse(ReadLine());
	int[] G() => ReadLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
	long[] GL() => ReadLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
	public const int MOD = 1000000007;
	public K()
	{
		//SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
		Solve();
		//Out.Flush();
	}
	int N;
	readonly List<Surface> all = new List<Surface>();
	readonly HashSet<Surface> empty = new HashSet<Surface>();
	readonly Dictionary<int, Dictionary<int, Dictionary<int, Dictionary<int, HashSet<Surface>>>>> dict = new Dictionary<int, Dictionary<int, Dictionary<int, Dictionary<int, HashSet<Surface>>>>>();
	void Solve()
	{
		var R = G();
		WriteLine(1 / (1.0 / R[0] + 1.0 / R[1]));
		/*N = F();
		var surf = new int[N][];
		for (var i = 0; i < N; i++)
		{
			surf[i] = G();
			for (var j = 0; j < 4; j++) all.Add(new Surface(i, surf[i], j));
		}
		foreach (var x in all) Add(x);
		// ans = e / 24
		var e = 0L;
		foreach (var x in all)
			foreach (var y in all)
			{
				if (x.Number == y.Number) continue;
				var s = new[] {
					Get(y[3], y[2], x[3], x[2]),
					Get(y[2], y[1], x[0], x[3]),
					Get(y[1], y[0], x[1], x[0]),
					Get(y[0], y[3], x[2], x[1])
				};
				var rx = new bool[4];
				var ry = new bool[4];
				for (var i = 0; i < 4; i++) ;
			}*/
	}
	void Add(Surface s)
	{
		int i = s[0], j = s[1], k = s[2], l = s[3];
		if (!dict.ContainsKey(i)) dict[i] = new Dictionary<int, Dictionary<int, Dictionary<int, HashSet<Surface>>>>();
		if (!dict[i].ContainsKey(j)) dict[i][j] = new Dictionary<int, Dictionary<int, HashSet<Surface>>>();
		if (!dict[i][j].ContainsKey(k)) dict[i][j][k] = new Dictionary<int, HashSet<Surface>>();
		if (!dict[i][j][k].ContainsKey(l)) dict[i][j][k][l] = new HashSet<Surface>();
		dict[i][j][k][l].Add(s);
	}
	HashSet<Surface> Get(int i, int j, int k, int l)
	{
		if (!dict.ContainsKey(i) || !dict[i].ContainsKey(j) || !dict[i][j].ContainsKey(k) || !dict[i][j][k].ContainsKey(l)) return empty;
		return dict[i][j][k][l];
	}
}
class Surface
{
	// 0 <= Number < N
	// 0 <= Rotate < 4 (mod 4)
	public int Number, Rotate;
	public int[] Color;
	public int this[int i]
	{
		get {
			return Color[(i + Rotate) % 4];
		}
	}
	public Surface(int n, int[] c, int r = 0)
	{
		Number = n;
		Color = c;
		Rotate = r;
	}
}