#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#define LL long long
#define N 100100
#define inf 999999999
using namespace std; //CF div2(225) B
int main()
{
int n, m, t, j, k, g;
while(scanf("%d%d%d", &n, &m, &k)!=EOF)
{
for(j=0; j<n; ++j)
{
for(t=0; t<m; ++t)
scanf("%d", &g);
}
printf("%d\n", m*(m-1)/2); //最多的种类数(不重复)
for(j=1; j<=m; ++j)
{
for(t=j+1; t<=m; ++t)
{
if(k==0)printf("%d %d\n", j, t); //从小到大
else printf("%d %d\n", t, j); //从大到小
}
}
}
return 0;
}
CF div2(225) B
最新推荐文章于 2022-05-02 22:23:52 发布