#include<bits/stdc++.h>
using namespace std;
long long mod=1000000007;
long long bigmod(long long base,long long pow1)
{
if(pow1==0)
return 1;
if(pow1%2==0)
{
long long ret=bigmod(base,pow1/2);
return ((ret%mod)*(ret%mod))%mod;
}
else
return ((base%mod)*(bigmod(base,pow1-1)%mod))%mod;
}
main()
{
long n,cs=1;
cin>>n;
while(n--)
{
long long n1,k,k1;
cin>>n1;
k1=n1-1;
k=bigmod(2,k1);
k=((n1%mod)*(k%mod))%mod;
printf("Case #%ld: %lld\n",cs++,k);
}
}
using namespace std;
long long mod=1000000007;
long long bigmod(long long base,long long pow1)
{
if(pow1==0)
return 1;
if(pow1%2==0)
{
long long ret=bigmod(base,pow1/2);
return ((ret%mod)*(ret%mod))%mod;
}
else
return ((base%mod)*(bigmod(base,pow1-1)%mod))%mod;
}
main()
{
long n,cs=1;
cin>>n;
while(n--)
{
long long n1,k,k1;
cin>>n1;
k1=n1-1;
k=bigmod(2,k1);
k=((n1%mod)*(k%mod))%mod;
printf("Case #%ld: %lld\n",cs++,k);
}
}
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন