#include using namespace atcoder; #include using namespace std; // #include #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i,a,b) for (int i = (int)(a); i <= (int)(b); i++) #define all(v) v.begin(),v.end() #define inc(x,l,r) ((l)<=(x)&&(x)<(r)) #define Unique(x) sort(all(x)), x.erase(unique(all(x)), x.end()) typedef long long ll; #define int ll using ld = long double; using vi = vector; using vs = vector; using P = pair; using vp = vector

; // using Bint = boost::multiprecision::cpp_int; template using priority_queue_greater = priority_queue, greater>; template ostream &operator<<(ostream &os,const vector &v){rep(i,v.size())os< istream &operator>>(istream& is,vector &v){for(T &in:v)is>>in;return is;} template void _IN(T&... a){(cin>> ... >> a);} template void _OUT(T& a){cout < void _OUT(const T&a, const Ts&... b){cout<< a;(cout<<...<<(cout<<' ',b));cout<<'\n';} #define INT(...) int __VA_ARGS__; _IN(__VA_ARGS__) #define STR(...) string __VA_ARGS__; _IN(__VA_ARGS__) #define pcnt __builtin_popcountll int ceil(int x,int y){return x/y+!!(x%y);} int abs(int x,int y){return abs(x-y);} bool ins(string s,string t){return s.find(t)!=string::npos;} P operator+ (const P &p, const P &q){ return P{p.first+q.first,p.second+q.second};} P operator- (const P &p, const P &q){ return P{p.first-q.first,p.second-q.second};} template ostream &operator<< (ostream &os, const pair &p){os << p.first <<" "<> (istream &is, modint1000000007 &m){ll in;is>>in;m=in;return is;} ostream &operator<< (ostream &os, const modint998244353 &m){os << m.val();return os;} istream &operator>> (istream &is, modint998244353 &m){ll in;is>>in;m=in;return is;} template bool chmax(T1 &a, const T2 b) {if (a < b) {a = b; return true;} else return false; } template bool chmin(T1 &a, const T2 b) {if (a > b) {a = b; return true;} else return false; } void yesno(bool ok,string y="Yes",string n="No"){ cout<<(ok?y:n)< struct LowLink { const G &g; vector< int > used, ord, low; vector< int > articulation;//切断点 vector< pair< int, int > > bridge;//橋 LowLink(const G &g) : g(g) {} int dfs(int idx, int k, int par) { used[idx] = true; ord[idx] = k++; low[idx] = ord[idx]; bool is_articulation = false; int cnt = 0; for(auto &to : g[idx]) { if(!used[to]) { ++cnt; k = dfs(to, k, idx); low[idx] = min(low[idx], low[to]); is_articulation |= ~par && low[to] >= ord[idx]; if(ord[idx] < low[to]) bridge.emplace_back(minmax(idx, (int) to)); } else if(to != par) { low[idx] = min(low[idx], ord[to]); } } is_articulation |= par == -1 && cnt > 1; if(is_articulation) articulation.push_back(idx); return k; } virtual void build() { used.assign(g.size(), 0); ord.assign(g.size(), 0); low.assign(g.size(), 0); int k = 0; for(int i = 0; i < g.size(); i++) { if(!used[i]) k = dfs(i, k, -1); } } }; signed main() { cin.tie(0); ios_base::sync_with_stdio(false); cout << fixed << setprecision(20); INT(n,m,q); vector G(n); rep(i,m){ INT(u,v); --u;--v; G[u].push_back(v); G[v].push_back(u); } LowLink> L(G); L.build(); dsu uf(n); for(auto &[u,v]:L.bridge)uf.merge(u,v); while(q--){ INT(x,y); --x;--y; yesno(uf.same(x,y)); } return 0; }