Saleh127

codeforces 1345B.cpp

Jun 9th, 2020
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define test int t; cin>>t; while (t--)
  4. #define ll long long int
  5. #define Faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  6. #define pi acos(-1)
  7. #define yes printf("YES\n");
  8. #define no printf("NO\n");
  9. int main()
  10. {
  11. Faster
  12. test
  13. {
  14. ll a,c=0,d,e,f,i,j,k;
  15. cin>>a;
  16. while(a>1)
  17. {
  18. c++;
  19. d=2;
  20. while(a>=d)
  21. {
  22. a-=d;
  23. d+=3;
  24. }
  25. }
  26. cout<<c<<endl;
  27. }
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment