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
45
46
47
48
#include <bits/stdc++.h>
using namespace std;

#define st first
#define nd second
#define iamspeed ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n, pol[105];
vector<int> V;

int main()
{
    iamspeed;
    cin >> n;
    if(n == 1)
    {
        cout << 2 << endl;
        cout << 2 << " " << -1 << endl;
        cout << -1 << " " << -1 << endl;
        return 0;
    }
    for(int i = 1 ; i < 100 ; i++)
    {
        pol[i] = -1;
    }
    while(n != 0)
    {
        V.push_back(n % 2);
        n /= 2;
    }
    reverse(V.begin(), V.end());
    for(int i = 1 ; i < V.size() ; i++)
    {
        pol[98 - 2 * i] = 98 - (2 * i) + 2;
    }
    V.erase(V.begin());
    for(int i = 0 ; i < V.size() ; i++)
    {
        if(V[i] == 1) pol[97 - (2 * i)] = 100;
    }
    cout << 100 << endl;
    for(int i = 1 ; i < 98 ; i++)
    {
        cout << i + 1 << " " << pol[i] << endl;
    }
    cout << -1 << " " << 100 << endl;
    cout << -1 << " " << -1 << endl;
    cout << -1 << " " << -1 << endl;
}