diff --git a/problem/P1258/P1258.cpp b/problem/P1258/P1258.cpp new file mode 100644 index 00000000..8796e041 --- /dev/null +++ b/problem/P1258/P1258.cpp @@ -0,0 +1,10 @@ +#include + +using namespace std; + +int main() { + double s, a, b; + scanf("%lf%lf%lf", &s, &a, &b); + printf("%.6lf\n", ((b + a) * s / (b + 3 * a)) / b + (s - ((b + a) * s / (b + 3 * a))) / a); + return 0; +} diff --git a/problem/P1258/P1258.py b/problem/P1258/P1258.py new file mode 100644 index 00000000..39721df9 --- /dev/null +++ b/problem/P1258/P1258.py @@ -0,0 +1,3 @@ +a = input().split() +print('%.6lf' % (((int(a[2]) + int(a[1])) * int(a[0]) / (int(a[2]) + 3 * int(a[1]))) / int(a[2]) + + (int(a[0]) - ((int(a[2]) + int(a[1])) * int(a[0]) / (int(a[2]) + 3 * int(a[1])))) / int(a[1])))