div2 620 A
作者:互联网
设所需要的时间为 \(t\),两只兔子之间的距离为 \(c ur\)
\(cut = (y-bt) - (x+at)\)
\(t = (y-x)/(a+b)\)
#include <bits/stdc++.h>
using namespace std;
int main() {
int x,y,t,a,b,ans;
cin >> t;
while(t --) {
cin >> x >> y >> a >> b;
if((y - x) % (a + b) == 0) cout << (y - x) / (a + b) << endl;
else cout << "-1\n";
}
return 0;
}
标签:620,cout,int,cin,ans,div2 来源: https://www.cnblogs.com/lukelmouse/p/12345160.html