Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #define N 1001
- using namespace std;
- int n,m,x,y;
- long long a[N];
- int main()
- {
- cin>>x>>y>>n>>m;
- if(x==1)
- for(int j=1;j<=m;++j)
- a[j]=j,cout<<a[j]<<' ';
- else
- {
- a[0]=x+y;
- for(int j=1;j<=y;++j)
- a[j]=a[j-1]-1,cout<<a[j]<<' ';
- for(int j=y+1;j<=m;++j)
- a[j]=a[j-1]+1,cout<<a[j]<<' ';
- }
- cout<<'\n';
- for(int i=2;i<=x;++i)
- {
- for(int j=1;j<=m;++j)
- --a[j],cout<<a[j]<<' ';
- cout<<'\n';
- }
- for(int i=x+1;i<=n;++i)
- {
- for(int j=1;j<=m;++j)
- ++a[j],cout<<a[j]<<' ';
- cout<<'\n';
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement