Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- unsigned long long ara[1601];
- void seive()
- {
- ara[0]=0;
- ara[1]=1;
- cout<<ara[0]<<" "<<ara[1]<<endl;
- for(unsigned long long i=2; i<=1600; i++)
- {
- ara[i]=ara[i-1]*2;
- cout<<ara[i]<<endl;
- }
- }
- int main()
- {
- //seive();
- int t;
- scanf("%d",&t);
- while(t--)
- {
- long long n;
- scanf("%lld",&n);
- long long bit=1,nibble=1,byte=1,x,y;
- if(n<=2)
- {
- bit=1,byte=0,nibble=0;
- }
- else if(2<n && n<=10)
- {
- bit=0,nibble=1,byte=0;
- }
- else if(10<n && n<=26)
- {
- bit=0,nibble=0,byte=1;
- }
- else
- for(x=27; x<=n; x++)
- {
- y=x%26;
- if(y==0)
- {
- byte=max(nibble,byte);
- nibble=0;
- bit=0;
- }
- else if(y>0 && y<=2)
- {
- bit=max(byte*2,bit);
- nibble=0;
- byte=0;
- }
- else if(y>2 && y<=10)
- {
- nibble=max(bit,nibble);
- bit=0;
- byte=0;
- }
- else
- {
- byte=max(nibble,byte);
- nibble=0;
- bit=0;
- }
- }
- printf("%lld %lld %lld\n",bit,nibble,byte);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement