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:
parent
9ee5e67514
commit
4a3d4d6ec0
10
problem/P1258/P1258.cpp
Normal file
10
problem/P1258/P1258.cpp
Normal 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
3
problem/P1258/P1258.py
Normal 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])))
|
Loading…
Reference in New Issue
Block a user