diff --git a/UVA/1595_Richr_Wong.cpp b/UVA/1595_Richr_Wong.cpp new file mode 100644 index 0000000..0e4e748 --- /dev/null +++ b/UVA/1595_Richr_Wong.cpp @@ -0,0 +1,51 @@ +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + + +typedef pair point; + +int main() +{ + int T; + cin>>T; + for(int i=0;i data; + cin>>n; + int sum = 0; + for(int j=0;j>x>>y; + sum+=x; + data.insert(point(x*n,y)); + } + bool flag = true; + for(set::iterator i=data.begin();i!=data.end();i++) + { + point p = *i; + if(data.find(point(2*sum-p.first,p.second))==data.end()) + { + flag = false; + break; + } + } + if(flag==true) + { + cout<<"YES"<