CF_402C Searching for Graph 乱搞题

时间:2023-12-13 13:04:20

题目链接:http://codeforces.com/problemset/problem/402/C

/**算法分析:
乱搞题,不明白题目想考什么
*/
#include<bits/stdc++.h> #define MAXN 1050
#define PI acos(-1.0)
#define REP(i,n) for(int i=0; i<n; i++)
#define FOR(i,s,t) for(int i=s; i<=t; i++)
#define mem(a,b) memset(a,b,sizeof(a))
#define show(x) { cerr<<">>>"<<#x<<" = "<<x<<endl; }
#define showtwo(x,y) { cerr<<">>>"<<#x<<"="<<x<<" "<<#y<<" = "<<y<<endl; }
using namespace std; int main()
{
int T; cin>>T;
while(T --)
{
int G[][]; mem(G,);
int n,p; cin>>n>>p;
int sum = *n+p,k = ;
while(sum)
{
REP(i,n)
{
G[i][(i+k)%n] = G[(i+k)%n][i] = ;
sum--;
if(!sum) break;
}
k++;
}
REP(i,n) FOR(j,i+,n-)
{
if(G[i][j]) cout<<i+<<" "<<j+<<endl;
}
}
}