Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- // your code goes here
- int t;
- cin>>t;
- for(int i=0;i<t;i++)
- {
- int a,b,n;
- cin>>a>>b>>n;
- if((b-a)%(n+1)==0)
- {
- cout<<"YES"<<endl;
- }
- else cout<<"NO"<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement