#include <bits/stdc++.h>
#include <iostream>
#include<unordered_map>
#define x first
#define y second
#define ios ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
typedef long long LL ;
typedef unsigned long long ULL ;
typedef pair<int,int> PII ;
typedef pair<LL,int> PLI ;
const int N = 2e5+10,M = 1000 * 100000 + 10 ,mod = 1000000007,INF1 = 0x3f3f3f3f;
const LL INF2 = 1e17;
int n,m,a,b,c;
bool st[N];
inline void solve()
{
cin>>n>>m;
::memset(st,0,sizeof st);
while(m -- )
{
cin>>a>>b>>c;
st[b]=1;
}
for(int i=1;i<=n;i ++ )
if(!st[i])
{
for(int j=1;j<=n;j ++ )
{
if(i != j ) cout << i << " " << j << endl;
}
break;
}
}
signed main()
{
ios
int T;cin>>T;
while(T -- )
{
solve();
}
return 0;
}
Omkar and Heavenly Tree(cf-1583b)(树)
最新推荐文章于 2024-07-14 13:39:50 发布