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
- ll m, s, a[101], i, z;
- int main ()
- {
- cin >> m >> s;
- if (m>s || s>m*9){
- cout << "-1 -1" << endl;
- return 0;
- }
- z=s/m;
- for (i=0; i<m-1; i++){
- cout << z;
- a[i]=z;
- s-=z;
- }
- a[i]=s;
- cout << a[i] << " ";
- for (i=m-1; i>=0; i--)
- cout << a[i];
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement