Advertisement
a53

Noduri Izolate

a53
Mar 14th, 2019
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. long double n,m;
  8. cin>>n>>m;
  9. if(m==0)
  10. {
  11. cout<<n<<' '<<n;
  12. return 0;
  13. }
  14. long double MIN=0,MAX=n-ceil((1+sqrt(1+8*m))/2);
  15. if(MAX<0)
  16. MAX=0;
  17. if(n>m*2)
  18. MIN=n-m*2;
  19. cout<<MIN<<' '<<MAX;
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement