/* Sample solution for NCPC'06: Random Walking * Author: Per Austrin */ #include #include #include #include using namespace std; int main(void) { int k, n, e, ok; for (; scanf("%d%d%d",&k,&n,&e),ok=1,k; printf("%s\n", ok?"Yes":"No")) { double p[1024], np[1024], bp[10]; vector adj[1024]; for (int i = 0, a, b; i < e; ++i) { scanf("%d%d", &a, &b), adj[a].push_back(b); if (a != b) adj[b].push_back(a); } for (int i = 0; i < (1< 1e-9 && fabs(bp[b]-0.75) > 1e-9); ok &= fabs(4*bp[b]-2) < 1; } } } return 0; }