#include <cmath>
#include <iostream>
using namespace std;
double parse(const char* prompt) {
cout << prompt;
double value;
cin >> value;
cin.ignore(0x1000, '\n'
;
return value;
}
double fn(const double a, const double b) {
static constexpr auto pi = 3.1415926535897932;
const auto ab = sqrt(a) + sqrt(b);
const auto sqr_ab = pow(ab, 2);
const auto ab1 = a * b + 1.0;
const auto sqr_ab1 = pow(ab1, 2);
const auto num = sqrt((sin(pow(ab / pi, 2)) + sqr_ab1) * (ab + 2.0 * sin(pow(ab1 / pi, 2))));
const auto den = sqrt(sqr_ab + ab1) * (sqr_ab + sqr_ab1);
return num / den;
}
int main() {
const auto a = parse("a: "
;
const auto b = parse("b: "
;
const auto x = fn(a, b);
if (isnan(x)) puts("Invalid argument"
;
else {
cout.setf(ios::fixed);
cout.precision(15);
cout << "x: " << x << '\n';
}
}