1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include<bits/stdc++.h>

using namespace std;

int edges[2][101];

int main()
{
    for(int i=1;i<=97;i++)
    {
        if(i%3==1)
        {
            edges[0][i]=i+1;
            edges[1][i]=i+2;
        }
        if(i%3==2)
        {
            edges[0][i]=i+2;
            edges[1][i]=-1;
        }
        if(i%3==0)
        {
            edges[0][i]=i+1;
            edges[1][i]=-1;
        }
    }
    edges[0][98]=-1;
    edges[1][98]=-1;
    edges[0][99]=-1;
    edges[1][99]=-1;
    edges[0][100]=-1;
    edges[1][100]=-1;
    int k;
    cin>>k;
    for(int i=1;k>0;k/=2,i++)
    {
        if(1==k%2)
            edges[1][i*3]=100;
    }
    cout<<100<<endl;
    for(int i=1;i<=100;i++)
        cout<<edges[0][i]<<" "<<edges[1][i]<<endl;

}