0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2025-01-11 16:31:58 +00:00
Baoshuo Ren 2022-03-05 20:05:58 +08:00
parent 92af895516
commit 8ef4b3dbe8
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

21
AtCoder/ABC242/A/A.cpp Normal file
View File

@ -0,0 +1,21 @@
#include <iomanip>
#include <iostream>
using std::cin;
using std::cout;
const char endl = '\n';
int a, b, c, x;
int main() {
std::ios::sync_with_stdio(false);
cin >> a >> b >> c >> x;
if (x <= a) {
cout << 1 << endl;
} else if (x > b) {
cout << 0 << endl;
} else {
cout << std::fixed << std::setprecision(10) << 1.00 * c / (b - a) << endl;
}
return 0;
}