Advertisement
a53

Wildfire1

a53
Jan 18th, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <iostream>
  2. #define N 1001
  3. using namespace std;
  4. int n,m,x,y;
  5. long long a[N];
  6.  
  7. int main()
  8. {
  9. cin>>x>>y>>n>>m;
  10. if(x==1)
  11. for(int j=1;j<=m;++j)
  12. a[j]=j,cout<<a[j]<<' ';
  13. else
  14. {
  15. a[0]=x+y;
  16. for(int j=1;j<=y;++j)
  17. a[j]=a[j-1]-1,cout<<a[j]<<' ';
  18. for(int j=y+1;j<=m;++j)
  19. a[j]=a[j-1]+1,cout<<a[j]<<' ';
  20. }
  21. cout<<'\n';
  22. for(int i=2;i<=x;++i)
  23. {
  24. for(int j=1;j<=m;++j)
  25. --a[j],cout<<a[j]<<' ';
  26. cout<<'\n';
  27. }
  28. for(int i=x+1;i<=n;++i)
  29. {
  30. for(int j=1;j<=m;++j)
  31. ++a[j],cout<<a[j]<<' ';
  32. cout<<'\n';
  33. }
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement