Problem:
Score : 100 points

Problem Statement

In order to pass the entrance examination tomorrow, Taro has to study for T more hours.

Fortunately, he can leap to World B where time passes X times as fast as it does in our world (World A).

While (X \times t) hours pass in World B, t hours pass in World A.

How many hours will pass in World A while Taro studies for T hours in World B?

Constraints

All values in input are integers.

1 \leq T \leq 100

1 \leq X \leq 100

Input

Input is given from Standard Input in the following format:

T X

Output

Print the number of hours that will pass in World A.

The output will be regarded as correct when its absolute or relative error from the judge's output is at most 10^{-3}.

Sample Input 1

8 3

Sample Output 1

2.6666666667

While Taro studies for eight hours in World B where time passes three times as fast, 2.6666... hours will pass in World A.

Note that an absolute or relative error of at most 10^{-3} is allowed.

Sample Input 2

99 1

Sample Output 2

99.0000000000

Sample Input 3

1 100

Sample Output 3

0.0100000000

Solution in C# (Mono 4.6.2.0) (judge verdict: Runtime Error)


using System;
using System.Collections.Generic;
using System.Linq;

namespace D
{
	class Program
	{
		static void Main()
		{
			var line1 = Console.ReadLine();
			var line1Splited = line1.Split(new char[] {' '}, StringSplitOptions.RemoveEmptyEntries);
			var line2 = Console.ReadLine();
			var line2Splited = line2.Split(new char[] {' '}, StringSplitOptions.RemoveEmptyEntries);

			var N = int.Parse(line1Splited[0]);
			var K = long.Parse(line1Splited[1]);

			var A = new List<long>();
			foreach (var token in line2Splited) A.Add(long.Parse(token));

			var KMaxDigit = Convert.ToString(K, 2).Length;

			var ABin = new string[A.Count];
			foreach (var item in A.Select((v, i) => new {v, i})) ABin[item.i] = Convert.ToString(item.v, 2).PadLeft(KMaxDigit, '0');
			
			var KBin = Convert.ToString(K, 2);
			// Console.WriteLine(KBin);

			var XIdealBin = "";
			for (int i = 0; i < KMaxDigit; i++) {
				int zeroNum = 0;
				foreach (var aBin in ABin) {
					if (aBin[i] == '0') zeroNum++;
					// Console.WriteLine($"{i}: {aBin[i]}");
				}
				XIdealBin += zeroNum > KMaxDigit - zeroNum ? '1' : '0';
			}
			// Console.WriteLine(XIdealBin);

			ulong f;
			ulong fMax = 0;
			string XBin;
			long X;
			for (int i = 0; i < KMaxDigit; i++) {
				XBin = "";
				
				// KBinのコピー
				for (int j = 0; j < i; j++) XBin += KBin[j];

				// 0
				XBin += '0';

				// XIdealBinのコピー
				XBin += XIdealBin.Substring(i + 1, KMaxDigit - i - 1);
				// Console.WriteLine($"X: {XBin}");

				X = Convert.ToInt64(XBin, 2);
				
				f = Xxor(A, X);
				if (fMax < f) fMax = f;
				// Console.WriteLine($"f({X}): {f}");
			}
			XBin = KBin;
			X = Convert.ToInt64(XBin, 2);
			f = Xxor(A, X);
			if (fMax < f) fMax = f;
			// Console.WriteLine($"X: {XBin}");
			// Console.WriteLine($"f({X}): {f}");

			Console.WriteLine(fMax);
		}

		static ulong Xxor(List<long> A, long X)
		{
			ulong sum = 0;
			foreach (var a in A) sum += (ulong)(a ^ X);
			return sum;
		}
	}
}