传送门
数论收尾ing(ง •̀_•́)ง
/*
ans*(2^m)==L (mod n+1)
2 mod n+1 的逆元为 n/2+1(这一步用费马小定理求迷之WA)
ans=L*(n/2+1)^m (mod n+1)
*/
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
inline ll fpow(ll a,ll b,ll MOD) {
ll ret=1;
while (b) {
if (b&1) ret=ret*a%MOD;
b>>=1,a=a*a%MOD;
}
return ret;
}
inline ll mult(ll x,ll y,ll MOD) {
x%=MOD,y%=MOD;
return ((x*y-(ll)(((long double)x*y+0.5)/MOD)*MOD)%MOD+MOD)%MOD;
}
int main() {
ll n,m,L;
cin>>n>>m>>L;
ll inv=(n>>1)+1;
cout<<mult(L,fpow(inv,m,n+1),n+1)<<endl;
return 0;
}