In the first line of the output file output a single integer k — the maximal possible number of episodes in the series. Then write k lines, each containing a description of an episode. For the episode in which character A (characters are numbered 1 through n) finds out the Truth, write the line “A 0”. For an episode in which character A finds out that character B knows the Truth, write the line “A B”. Similarly, for an episode in which character A finds out that character B doesn’t know the Truth, write the line “A -B”. If there are several plans providing the maximal possible number of episodes, output any one of them.
//qscqesze
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <bitset>
#include <vector>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <fstream>
#include <map>
#include <stack>
typedef long long ll;
using namespace std;
//freopen("D.in","r",stdin);
//freopen("D.out","w",stdout);
#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)
#define maxn 110000
#define mod 1001
#define eps 1e-9
#define pi 3.1415926
int Num;
//const int inf=0x7fffffff; //§ß§é§à§é¨f§³
const ll inf=999999999;
inline ll read()
{
ll x=0,f=1;char ch=getchar();
while(ch<‘0‘||ch>‘9‘){if(ch==‘-‘)f=-1;ch=getchar();}
while(ch>=‘0‘&&ch<=‘9‘){x=x*10+ch-‘0‘;ch=getchar();}
return x*f;
}
//*************************************************************************************
map< pair<int,int> ,int> H;
vector<pair<int,int> > V;
int main()
{ // horrible.out
freopen("horrible.in","r",stdin);
freopen("horrible.out","w",stdout);
int n=read();
int tot=0;
if(n==1)
{
printf("1\n");
printf("1 0\n");
return 0;
}
V.push_back(make_pair(2,-1));
for(int i=1;i<=n;i++)
{
V.push_back(make_pair(i,0));
int ttt = 0;
int flag = 1;
while(flag)
{
flag=0;
ttt++;
if(ttt%2==1)
{
flag=0;
for(int ii=1;ii<=n;ii++)
{
if(i==ii)
continue;
if(H[make_pair(ii,i)])
continue;
H[make_pair(ii,i)]=1;
V.push_back(make_pair(ii,i));
flag=1;
break;
}
}
else
{
flag=0;
for(int jj=i+1;jj<=n;jj++)
{
for(int ii=1;ii<=n;ii++)
{
if(ii==jj)
continue;
if(H[make_pair(ii,-jj)])
continue;
H[make_pair(ii,-jj)]=1;
V.push_back(make_pair(ii,-jj));
flag=1;
break;
}
if(flag)
break;
}
}
}
}
printf("%d\n",V.size());
for(int i=0;i<V.size();i++)
printf("%d %d\n",V[i].first,V[i].second);
}