You are viewing a single comment's thread. Return to all comments →
int main(){ long long int t,n,p; scanf("%lld",&t); while(t--){ scanf("%lld",&n); if(n%2!=0){ printf("0\n"); }else if(n==2){ printf("6\n"); } else{ p=log(n)/log(2); printf("%lld\n",(p*6)%10); } } }
Seems like cookies are disabled on this browser, please enable them to open this website
Little Gaurav and Sequence
You are viewing a single comment's thread. Return to all comments →
int main(){ long long int t,n,p; scanf("%lld",&t); while(t--){ scanf("%lld",&n); if(n%2!=0){ printf("0\n"); }else if(n==2){ printf("6\n"); } else{ p=log(n)/log(2); printf("%lld\n",(p*6)%10); } } }