Advertisement
sketkar

Valid AP-ICL2023

Mar 10th, 2023
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int t;
  7. cin>>t;
  8. for(int i=0;i<t;i++)
  9. {
  10. int a,b,n;
  11. cin>>a>>b>>n;
  12. if((b-a)%(n+1)==0)
  13. {
  14. cout<<"YES"<<endl;
  15. }
  16. else cout<<"NO"<<endl;
  17. }
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement