#include <fstream>
#include <iomanip>

using namespace std;

long double A(int a)
{
	if (a == 0)
	{
		return 0;
	}
	return (long double)(1) / (long double)(a)+A(a - 1);
}

long double B(int &a, int &temp, int i = 0)
{
	if (i > a)
	{
		return 0;
	}
	if (i == 0)
	{
		temp = 1;
	}
	else
	temp *= 2 * i;
	return (long double)(1) / (long double)(temp)+B(a, temp, i + 1);
}

int main()
{
	ifstream input("DQAB.inp");
	ofstream output("DQAB.out");

	int a;
	int temp;
	input >> a;
	output << fixed << setprecision(3) << A(a) << '\n' << B(a, temp);
	input.close();
	output.close();
	return 0;
}