码风不好,请大佬见谅
#include "bits/stdc++.h"
using std::cin;
using std::cout;
long double a, b, c, d;
long double n;
int main(void) {
cin >> a;
for (int i = 1; i <= a; i++) {
cin >> b >> c >> d;
if (b > c) {
n = b / c;
n = n * d + d;
cout << n << "\n";
continue;
} else {
n = c / b;
n = n * d + d;
cout << n << "\n";
continue;
}
}
return 0;
}