题解
2026-08-02 20:57:22
发布于:广东
25阅读
0回复
0点赞
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout << fixed << setprecision(9);
int c,T;
cin >> c >> T;
while(T--){
int n;
long long x,y,v0;
cin >> n >> x >> y >> v0;
double a;
if(x == y){
a = 0;
}else if(v0 == 0){
a = 1e18;
}else{
a = (double)(y - x) / v0;
}
for(int i = 0;i < n;i++){
long long t,v;
cin >> t >> v;
double b = (double)t + (double)y / v;
if(b < a){
a = b;
}
}
cout << fixed << setprecision(9) << a << '\n';
}
return 0;
}
全部评论 2
78
3天前 来自 浙江
01
2026-08-02 来自 广东
0














有帮助,赞一个