#include<fstream.h>
fstream f("date.in",ios::in);
fstream g("date2.in",ios::in);
int a[100][100],b[100][100],n,m,k,l;
void citire()
{int x,y,i;
f>>n>>m;
for(i=1;i<=m;i++)
{f>>x>>y;
a[x][y]=1;
a[y][z]=1;
}
g>>k>>l;
for(i=1;i<=l;i++)
{g>>x>>y;
b[x][y]=1;
b[y][x]=1;
}
}
int subgraf()
{for(int i=1;i<=k;i++)
for(int j=1;j<=k;j++)
if(a[i][j]!=b[i][j]) return 0;
return 1;
}
void main()
{citire();
if(subgraf()) cout<<"da";
else cout<<"nu";
}
|