#include"iostream"
#include"algorithm"
#include"vector"
#include"map"
#include"string"
#include"deque"
#include"queue"
#include"stack"
#include"cstdio"
#include"cmath"
#include"set"
using namespace std;
struct ractangle
{
int l;
int w;
friend bool operator < (ractangle &a,ractangle &b)//按x,y排序
{
if(a.l<b.l)
return true;
else if(a.l==b.l)
return a.w<b.w;
else
return false;
}
friend bool operator !=(ractangle &a,ractangle &b)
{
return a.l!=b.l||a.w!=b.w;
}
};
int main()
{
//freopen("a.txt","r",stdin);
int k=0;
int x,y;
while(cin>>x>>y)
{
ractangle a[6];
a[k].l=x;
a[k].w=y;
if(a[k].l<a[k].w)
swap(a[k].l,a[k].w);
k++;
if(k==6)
{
k=0;
int p=1;
sort(a,a+6);
int i;
/*for(i=0;i<6;i++)
cout<<a[i].l<<" "<<a[i].w<<endl; */
if(a[0]!=a[1]||a[2]!=a[3]||a[4]!=a[5])
p=0;
if(a[0].w!=a[2].w||a[0].l!=a[4].w||a[2].l!=a[4].l)
p=0;
if(p)
cout<<"POSSIBLE\n";
else
cout<<"IMPOSSIBLE\n";
}
}
return 0;
}
UVA1587
最新推荐文章于 2020-02-05 11:21:59 发布