This is the code which is $$$O(n^2)$$$ that passed this problem. The std is $$$O(nlogn)$$$.
this is the hack.
#include<bits/stdc++.h>
using namespace std;
int main()
{
freopen("and.in","w",stdout);
cout<<"300000 300000\n";
cout<<1<<' ';
for(int i=2;i<=300000-2;i++)
{
cout<<0<<' ';
}
cout<<3<<' '<<2<<'\n';
for(int i=1;i<=300000;i++)
{
cout<<1<<' '<<300000<<'\n';
}
return 0;
}
orz