Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define suni ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
- int main()
- {
- ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
- long long n, m, u, a,b,c;
- map<long long, bool> mp;
- int tc;
- cin>>tc;
- while(tc--)
- {
- mp.clear();
- cin>>n>>m;
- for(long long i=1; i<=m; i++)
- {
- cin>>a>>b>>c;
- mp[b] = true;
- }
- for(long long i=1; i<=n; i++)
- {
- if(mp[i] == false)
- {
- u= i;
- break;
- }
- }
- for(long long i=1; i<=n; i++)
- {
- if(i != u) cout<<u<<" "<<i<<endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement