#include using namespace std; typedef unsigned int uint; typedef long long int ll; typedef unsigned long long int ull; #define debugv(v) printf("L%d %s => ",__LINE__,#v);for(auto e:v){cout< ",__LINE__,#m);for(int x=0;x<(w);x++){cout<<(m)[x]<<" ";}cout<(t).count()) template ostream& operator <<(ostream &o,const pair p){o<<"("< data; UnionFind(int size) : data(size, -1) { } bool unionSet(int x, int y) { x = root(x); y = root(y); if (x != y) { if (data[y] < data[x]) swap(x, y); data[x] += data[y]; data[y] = x; } return x != y; } bool findSet(int x, int y) { return root(x) == root(y); } int root(int x) { return data[x] < 0 ? x : data[x] = root(data[x]); } int size(int x) { return -data[root(x)]; } }; struct QuickFind{ vector toGroup; vector> toItems; QuickFind(int size){ toGroup.resize(size); toItems.resize(size); for (int i=0;i> alive; pair bridge[200005]; pair destroy[200005]; int order[200005]; int main(){ int i,j,k,l; int a,b,c,d; cin>>n>>m>>q; // load for (i=0;i