Special Ability 2

No attempts yetTime limit2sMemory limit512 MB

Problem

You are given a directed graph with NN vertices and MM edges. The vertices are numbered from 1 to NN, and every edge carries an integer weight of 0 or more. Two vertices can be joined by several edges, and an edge may start and end at the same vertex.

Seongwon is standing on vertex 1. He moves to other vertices along edges, and traversing one edge costs that edge's weight.

Seongwon has a special ability. When he traverses an edge, using the ability makes that traversal cost the edge's weight multiplied by -1. He can use the ability at most CC times, and one use applies to a single traversal of a single edge. He may traverse the same edge several times, and he may use the ability again on each traversal. He may also arrive at vertex NN with uses of the ability left over.

Write a program that finds the minimum cost for Seongwon to start at vertex 1 and arrive at vertex NN.

Input

The first line contains the number of vertices NN, the number of edges MM, and the number of times the special ability can be used, CC. (1N501 \le N \le 50, 1M25001 \le M \le 2500, 0C1090 \le C \le 10^9)

Each of the next MM lines contains one edge as from\text{from}, to\text{to}, cost\text{cost}. (1fromN1 \le \text{from} \le N, 1toN1 \le \text{to} \le N, 0cost1000000 \le \text{cost} \le 100000) from\text{from} is the start of the edge and to\text{to} is its end, so the edge can be traversed only in the direction from from\text{from} to to\text{to}.

Every graph given as input allows travel from vertex 1 to vertex NN.

Output

Print the minimum cost for Seongwon to travel from vertex 1 to vertex NN on the first line.