fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. ios_base::sync_with_stdio(false);
  6. cin.tie(0);
  7. cout.tie(0);
  8. int t,c=0;
  9. cin>>t;
  10. while(t--)
  11. {
  12. long long x,y=0;
  13. cin>>x;
  14. for(int i=1;i<x;i++)
  15. {
  16.  
  17. if(x-y<i)
  18. break;
  19. y+=i;
  20. c++;
  21. }
  22. }
  23. cout<<c;
  24. return 0;
  25. }
Success #stdin #stdout 0.01s 5516KB
stdin
1
30

stdout
7