Alhiris

Untitled

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