#include <cstdio> int main() { int N; scanf("%d", &N); printf("100\n"); for (int i=1; i<=98; ++i) { if (i%2 == 1) { printf("%d %d\n",i+1, i+2); } else { printf("%d %d\n", i+1, (N&1)?100:-1); N>>=1; } } printf("-1 -1\n-1 -1\n"); return 0; }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #include <cstdio> int main() { int N; scanf("%d", &N); printf("100\n"); for (int i=1; i<=98; ++i) { if (i%2 == 1) { printf("%d %d\n",i+1, i+2); } else { printf("%d %d\n", i+1, (N&1)?100:-1); N>>=1; } } printf("-1 -1\n-1 -1\n"); return 0; } |