Advertisement
Guest User

Untitled

a guest
Dec 30th, 2020
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.73 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #include<ext/pb_ds/assoc_container.hpp>
  4. #include<ext/pb_ds/tree_policy.hpp>
  5. using namespace std;
  6. using namespace __gnu_pbds;
  7. const int p = 31;
  8. const int m = 1e9 + 7;
  9. typedef long long ll;
  10. typedef int in;
  11. #define ff first
  12. #define ss second
  13. void __print(int x) {cerr << x;}
  14. void __print(long x) {cerr << x;}
  15. void __print(long long x) {cerr << x;}
  16. void __print(unsigned x) {cerr << x;}
  17. void __print(unsigned long x) {cerr << x;}
  18. void __print(unsigned long long x) {cerr << x;}
  19. void __print(float x) {cerr << x;}
  20. void __print(double x) {cerr << x;}
  21. void __print(long double x) {cerr << x;}
  22. void __print(char x) {cerr << '\'' << x << '\'';}
  23. void __print(const char *x) {cerr << '\"' << x << '\"';}
  24. void __print(const string &x) {cerr << '\"' << x << '\"';}
  25. void __print(bool x) {cerr << (x ? "true" : "false");}
  26. template<typename T, typename V>
  27. void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
  28. template<typename T>
  29. void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
  30. void _print() {cerr << "]\n";}
  31. template <typename T, typename... V>
  32. void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
  33. #ifndef ONLINE_JUDGE
  34. #define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
  35. #else
  36. #define debug(x...)
  37. #endif
  38.  
  39. in main () {
  40.     int n;
  41.     cin>>n;
  42.     if(n<=11){
  43.         int i=1;
  44.         while(i<=n){
  45.             cout<<max(i-1,1)<<" "<<min(i+1,n)<<'\n';
  46.             ++i;
  47.         }
  48.     }
  49.     else{
  50.         cout<<(n+1)/2<<" "<<n<<'\n';
  51.         for(int i=2;i<n;++i){
  52.             cout<<(i+1)/2<<" "<<(n+i+1)/2<<'\n';
  53.         }
  54.         cout<<(n+1)/2<<" "<<1;
  55.     }
  56.     return 0;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement