运行以下代码即可。
#include <bits/stdc++.h>
using namespace std;
const int n = 10000;
const int i = 10000;
const int h = 1000000;
const int R = n-1;
int main(){
freopen("P2879.in", "w", stdout);
cout << n << " " << i << " " << h << " " << R << endl;
int a=1, b=n;
for(int r=0; r!=R; ++r){
cout << a << " " << b << endl;
swap(a, b);
if(a<b) ++a;
else --a;
}
return 0;
}
本题的数据规模还是太小了,以上 hack 数据对大多数平方程序也跑不过 2.5s(本地测试,非常规运行环境)。
建议 Subtask #2 n,R≤105,改变上面代码中的常量即可生成更大的 hack 数据。