#include using namespace std; typedef long long ll; typedef pair edge; typedef pair Data; const ll INF = (1LL<<60); ll ans=INF; ll N,M,K; vector g[100000]; ll d[100000][4]; ll cost[100000]; int main(){ scanf("%lld %lld %lld",&N,&M,&K); for(int i=0;i, greater > que; que.push( Data(0,edge(0,K) ) ); d[0][K]=0; while(!que.empty()){ Data dat = que.top(); que.pop(); ll pos = dat.second.first; ll tk = dat.second.second; ll cost = dat.first; if(pos==N-1)ans=min(ans,cost); if(d[pos][tk] ncost ){ d[to][tk]=ncost; que.push( Data(ncost,edge(to,tk)) ); } ll nk=tk-1; if(nk>=0){ if( d[to][nk] > cost ){ d[to][nk]=cost; que.push( Data(cost,edge(to,nk)) ); } } } } if(ans==INF)ans=-1; cout<