Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define pii pair<int , int>
- #define fast()(ios_base::sync_with_stdio(0),cin.tie(NULL));
- int main()
- {
- fast()
- int n;
- cin>>n;
- int x[]={1,-1,0,0};
- int y[]={0,0,1,-1};
- int x_ord=1,y_ord=1;
- set<pii>v;
- v.insert(make_pair(0,0));
- while(n--)
- {
- v.insert(make_pair(x_ord,y_ord));
- for(int i=0;i<4;i++)v.insert(make_pair(x_ord+x[i],y[i]+y_ord));
- x_ord++,y_ord++;
- }
- v.insert(make_pair(x_ord,y_ord));
- cout<<v.size()<<endl;
- for(auto x: v)
- {
- cout<<x.first<<" "<<x.second<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement