题解:P16672 【MX-J30-T1】「FDOI-R1」擦肩而过
题解
观察方程
槽点
代码
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,m,T,t,x,a,b,c;
int main(){
cin>>T;
while(T--){
cin >> x >> a >> b >> t;
ll A = x - t, B = x + t, C = a + b, s = 0;
if(A % C == 0 && A >= 0 && t != 0) s ++;
if(B % C == 0) s ++;
cout << s << '\n';
}
}