#include <iostream>
#include <cstdio>
using namespace std;
#define MOD 1000000007
#define LL long long
int n;
LL fp(LL a,int b)
{
LL cnt=1;
while(b)
{
if(b&1)
cnt=cnt*a%MOD;
a=a*a%MOD;
b>>=1;
}
return cnt;
}
LL ans;
int main()
{
scanf("%d",&n);
ans=fp(27,n)-fp(7,n);
if(ans<0)
ans+=MOD;
cout<<ans<<"\n";
}
cf#324 Div.2 Problem B Kolya and Tanya
最新推荐文章于 2020-02-25 18:55:17 发布