Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- long double n,m;
- cin>>n>>m;
- if(m==0)
- {
- cout<<n<<' '<<n;
- return 0;
- }
- long double MIN=0,MAX=n-ceil((1+sqrt(1+8*m))/2);
- if(MAX<0)
- MAX=0;
- if(n>m*2)
- MIN=n-m*2;
- cout<<MIN<<' '<<MAX;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement