#include <iostream> using namespace std; int main() { int n; cin>>n; cout<<92 <<endl; for(int i = 1 ; i < 91 ; i ++) { if(i%3==1) cout<<i+1<<" "<<i+2<<"\n"; else if(i%3==2) cout<<i+2<<" -1\n"; else { cout<<i+1<<" "; if(n%2==1)cout<<92<<"\n"; else cout<<-1<<"\n"; n/=2; } } cout<<"-1 -1\n-1 -1\n"; }
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 | #include <iostream> using namespace std; int main() { int n; cin>>n; cout<<92 <<endl; for(int i = 1 ; i < 91 ; i ++) { if(i%3==1) cout<<i+1<<" "<<i+2<<"\n"; else if(i%3==2) cout<<i+2<<" -1\n"; else { cout<<i+1<<" "; if(n%2==1)cout<<92<<"\n"; else cout<<-1<<"\n"; n/=2; } } cout<<"-1 -1\n-1 -1\n"; } |