fork download
  1. // Online C++ compiler to run C++ program online
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4.  
  5.  
  6.  
  7. int main() {
  8. // Write C++ code here
  9.  
  10. int t;
  11. cin>>t;
  12. while(t--)
  13. {
  14. int x;
  15. cin>>x;
  16. if(x%3==0)
  17. {
  18. cout<<0<<endl;
  19.  
  20. }
  21. else
  22. {
  23. cout<<(x/3)+1<<endl;
  24.  
  25. }
  26.  
  27. }
  28.  
  29.  
  30. return 0;
  31. }
Success #stdin #stdout 0.01s 5320KB
stdin
2
7
24
stdout
3
0