Advertisement
Guest User

Untitled

a guest
Jun 21st, 2017
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.18 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     int n;
  8.     cin >> n;
  9.     cout << ceil((sqrt(1 + 8 * (n - 1)) - 1) / 2) << endl;
  10.     return 0;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement