标签:
#include<cstdio>
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<queue>
#include<deque>
#include<set>
#include<map>
#include<ctime>
#define LL long long
#define inf 0x7ffffff
#define mod (LL)(n+1LL)
using namespace std;
inline LL read()
{
LL x=0,f=1;char ch=getchar();
while(ch<‘0‘||ch>‘9‘){if(ch==‘-‘)f=-1;ch=getchar();}
while(ch>=‘0‘&&ch<=‘9‘){x=x*10+ch-‘0‘;ch=getchar();}
return x*f;
}
LL n,m,l,ans;
inline LL quickpow(LL a,LL b)
{
LL m=a,s=1ll;
while (b)
{
if (b&1)s=(s*m)%mod;
m=(m*m)%mod;
b>>=1;
}
return s;
}
int main()
{
n=read();m=read();l=read();
ans=quickpow((LL)n/2+1,m);
ans=(ans*l)%mod;
printf("%lld\n",ans);
}
标签:
原文地址:http://www.cnblogs.com/zhber/p/4215799.html