Link:

Codeforces #190 传送门

 

A:

明显答案为$n+m-1$且能构造出来

#include <bits/stdc++.h>

using namespace std;
#define X first
#define Y second
typedef long long ll;
typedef double db;
typedef pair<int,int> P;
int n,m;

int main()
{
    scanf("%d%d",&n,&m);
    printf("%d\n",n+m-1);
    for(int i=1;i<=m;i++)
        printf("1 %d\n",i);
    for(int i=2;i<=n;i++)
        printf("%d 1\n",i);
    return 0;
}
Problem A

相关文章: