fork(1) download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long int
  4. #define mod 1000000007
  5. #define pb push_back
  6. #define fr first
  7. #define sc second
  8. int dx[4]={0,0,1,-1},dy[4]={1,-1,0,0},dxx[8]={0,0,1,1,1,-1,-1,-1},dyy[8]={1,-1,0,1,-1,0,1,-1};
  9. //914836017997511610
  10. int main()
  11. { ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  12.  
  13. int q;
  14. cin>>q;
  15. ll t,ans,x,mark;
  16. int i,a[3]={2,8,16};
  17. while(q--)
  18. { cin>>t;
  19. bool flag=false;
  20. x=0;mark=0;
  21. while(t>0)
  22. { //cout<<"tt"<<t<<endl;
  23. for(i=0;i<3;++i)
  24. { mark=i;
  25. if(t-a[i]<=0)
  26. {flag=true;break;}
  27. t-=a[i];
  28. }
  29. if(flag)
  30. break;
  31. ++x;
  32. }
  33. ans=1LL<<x;
  34. for(i=0;i<3;++i)
  35. {
  36. if(i==mark)
  37. {cout<<ans<<" ";continue;}
  38. else
  39. cout<<0<<" ";
  40. }
  41. cout<<"\n";
  42. }
  43. return 0;
  44. }
Time limit exceeded #stdin #stdout 5s 15232KB
stdin
Standard input is empty
stdout
Standard output is empty