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
#include <cstdio>
#include <cmath>
#include <vector>
using namespace std;

int k;
vector<int> g[105];

int main(){
	scanf("%d", &k);
	int k2 = k;
	int c = 1;
	while (k2 > 1){
		g[c].push_back(c + 1);
		g[c].push_back(c + 2);
		g[c + 2].push_back(c + 3);
		g[c + 1].push_back(c + 3);
		if (k2 % 2 == 1){
			g[c + 1].push_back(100);
		}
		c += 3;
		k2 /= 2;
	}
	if (k2 == 1){
		g[c].push_back(100);
	}
	printf("100\n");
	for (int i = 1; i <= 100; i++){
		if (g[i].size() == 0){
			printf("-1 -1\n");
		}
		else if (g[i].size() == 1){
			printf("%d -1\n", g[i][0]);
		}
		else {
			printf("%d %d\n", g[i][0], g[i][1]);
		}
	}

}