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