present from lina codeforces
#include<bits/stdc++.h>
using namespace std;
#define iter(a, b, c) for(auto(a) = (b); (a) < (c); ++(a))
#define mod 1000000007
#define pb push_back
#define ff first
#define ss second
#define FIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define test(w) int w;cin>>w;while(w--)
int main() {
int n; cin>>n;
iter(i,0,2*n+1){
iter(k,0,abs(n-i)) cout<<" ";
int j=0;
for(;j<n-abs(n-i);j++) cout<<j<<" ";
while(j>0) cout<<j--<<" ";
cout<<0<<endl;
}
}
Comments
Post a Comment