0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 18:31:59 +00:00

P1258 小车问题

C++: R40248094
Python: R40249214
This commit is contained in:
Baoshuo Ren 2020-10-21 21:46:15 +08:00 committed by Baoshuo Ren
parent 9ee5e67514
commit 4a3d4d6ec0
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68
2 changed files with 13 additions and 0 deletions

10
problem/P1258/P1258.cpp Normal file
View File

@ -0,0 +1,10 @@
#include <bits/stdc++.h>
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;
}

3
problem/P1258/P1258.py Normal file
View File

@ -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])))