Binary Sequence

  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. long long t,x,y,a,b;
  6. cin>>t;
  7. while(t--)
  8. {
  9. cin>>x>>y>>a>>b;
  10. if(x*y == a+b)
  11. cout<<"Yes\n";
  12. else
  13. cout<<"No\n";
  14. }
  15. return 0;
  16. }

  1. n=int(input())
  2. for i in range(n):
  3. x,y,a,b=map(int,input().split())
  4. if x*y == a+b:
  5. print('Yes')
  6. else:
  7. print('No')
https://www.hackerearth.com/practice/python/getting-started/numbers/practice-problems/algorithm/binary-sequence-dbaf9d61/


0 Responses