#include #include #include #include #define M_EPS (double)1e-16 double P(int a, int b, double g1, double g2) { return (1e3 / (g1 * g2) + 1.0 / (a + b)); } double R(int a, int b, int c) { return (1.0 * a * b / c + 1.0 * b / (a * c)); } double T(int a, int b, int c) { return (1.0 * (a + b) / (c + b) + (a + 1.0 * b / c) / (c + 1.0 * a / b)); } bool isEqualInt(double a) { if (ceil(a) - floor(a) < M_EPS) return true; return false; } int main(void) { FILE *fout = fopen("f10.txt", "wt"); int a, b, c; double g1, g2; scanf("%d %d %d %lf %lf", &a, &b, &c, &g1, &g2); bool isFInt, isFDoub; isFInt = isFDoub = true; double tmp = P(a, b, g1, g2); if (isEqualInt(tmp)) { system("cls && echo off && color F1 && echo on"); printf("\n\n\n\n %.0f", tmp); isFInt = false; } else { fprintf(fout, "\n\n\n\n\n\n\n %.16f", tmp); isFDoub = false; } tmp = R(a, b, c); if (isEqualInt(tmp)) { if (isFInt) { system("cls && echo off && color F1 && echo on"); printf("\n\n\n\n %.0f", tmp); isFInt = false; } else { printf(" %.0f", tmp); } } else { if (isFDoub) { fprintf(fout, "\n\n\n\n\n\n\n %.16f", tmp); isFDoub = false; } else { fprintf(fout, " %.16f", tmp); } } tmp = T(a, b, c); if (isEqualInt(tmp)) { if (isFInt) { system("cls && echo off && color F1 && echo on"); printf("\n\n\n\n %.0f", tmp); } else { printf(" %.0f", tmp); } } else { if (isFDoub) { fprintf(fout, "\n\n\n\n\n\n\n %.16f", tmp); } else { fprintf(fout, " %.16f", tmp); } } return 0; }