Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- #define debug(x) cout << #x << " = " << x << endl
- typedef unsigned long long ULL;
- using namespace std;
- const int N=100000;
- string f(int n,int m)
- {
- if(n<=m)
- {
- if(n==m)
- {
- return to_string(n);
- }
- return f(n,m-1)+" "+to_string(m);
- }
- if(n>=m)
- {
- if(m==n)
- {
- return to_string(m);
- }
- return f(n,m+1)+" "+to_string(m);
- }
- }
- int a[N],n,m;
- int main ()
- {
- cin >> n>>m;
- cout << f(n,m);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement