Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdio>
- #include <algorithm>
- #include <cstring>
- #include <string>
- #include <cctype>
- #include <stack>
- #include <queue>
- #include <list>
- #include <vector>
- #include <map>
- #include <set>
- #include <sstream>
- #include <stdlib.h>
- #include <cmath>
- #define LL unsigned long long
- using namespace std;
- int main() {
- int t;
- double n;
- double n1;
- scanf("%d",&t);
- while(t--){
- scanf("%lf",&n);
- n1=-1+(sqrt(1+(8*n)));
- n1=n1/2;
- int k = (int) n1;
- printf("%d\n",k);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement