Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define _test int _TEST; cin>>_TEST; while(_TEST--)
- int main()
- {
- _test
- {
- int a, b, c;
- cin>>a>>b>>c;
- multiset<int> mst;
- mst.insert(a);
- mst.insert(b);
- mst.insert(c);
- for(int i=0; i<3 && *mst.rbegin()!=*mst.begin(); i++)
- {
- int x = *mst.rbegin();
- mst.erase(--mst.end());
- mst.insert(*mst.begin());
- mst.insert(x-*mst.begin());
- }
- if(*mst.rbegin()==*mst.begin()) cout<<"YES\n";
- else cout<<"NO\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment