#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define nl cout<<endl

#define pii pair<ll,ll>
#define vi  vector<ll>
#define vii vector<pii>
#define mi  map<ll,ll>
#define all(a)  (a).begin(),(a).end()

#define pb push_back
#define ff first
#define ss second
#define hell 1000000007

#define test4(x,y,z,a) cout<<"x is "<<x<<"		y is "<<y<<"		z is "<<z<<"		a is "<<a<<endl;
#define test3(x,y,z) cout<<"x is "<<x<<"		y is "<<y<<"		z is "<<z<<endl;
#define test2(x,y) cout<<"x is "<<x<<"		y is "<<y<<endl;
#define test1(x) cout<<"x is "<<x<<endl;
#define N 300009

ll power(ll a,ll b,ll m)
{
	ll ans=1;
	while(b)
	{
		if(b&1)
			ans=(ans*a)%m;
		b/=2;
		a=(a*a)%m;
	}
	return ans;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	ll n,m;cin>>n>>m;
	ll a[n+2]={0};
	vii v[2];
	rep(i,1,m+1)
	{
		ll aa,b,c;cin>>aa>>b>>c;
		/*if(m==906 and i==443)
			test3(aa,b,c);*/
		v[aa].pb({b,c});
	}
	sort(all(v[0]));
	sort(all(v[1]));

	rep(i,0,v[1].size())
	{
		rep(j,v[1][i].ff,v[1][i].ss)
			a[j]=-1;
	}
	rep(i,1,n+1)
		if(!a[i])
			a[i]=+1;
	/*	rep(i,1,n+1)
		cout<<a[i]<<" ";nl;*/
	a[n]=n;
	for(ll i=n-1;i>=1;i--){
		if(i==n)
			a[i]=n;
		else
			a[i]=a[i+1]+a[i];
	}
	/*rep(i,1,n+1)
		cout<<a[i]<<" ";nl;*/
	bool flag=0;
	rep(i,0,v[0].size())
	{
		flag=0;
		rep(j,v[0][i].ff+1,v[0][i].ss+1)
			if(a[j-1]>a[j])
				flag=1;
		if(flag==0)
		{
			cout<<"NO"<<endl;
			return 0;
		}
	}
	/*if(flag or v[0].size()==0)
	{*/
		cout<<"YES"<<endl;
		rep(i,1,n+1)
			cout<<a[i]<<" ";nl;
	/*}
	else
		cout<<"NO"<<endl;*/

}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define nl cout<<endl

#define pii pair<ll,ll>
#define vi  vector<ll>
#define vii vector<pii>
#define mi  map<ll,ll>
#define all(a)  (a).begin(),(a).end()

#define pb push_back
#define ff first
#define ss second
#define hell 1000000007

#define test4(x,y,z,a) cout<<"x is "<<x<<"		y is "<<y<<"		z is "<<z<<"		a is "<<a<<endl;
#define test3(x,y,z) cout<<"x is "<<x<<"		y is "<<y<<"		z is "<<z<<endl;
#define test2(x,y) cout<<"x is "<<x<<"		y is "<<y<<endl;
#define test1(x) cout<<"x is "<<x<<endl;
#define N 300009

ll power(ll a,ll b,ll m)
{
	ll ans=1;
	while(b)
	{
		if(b&1)
			ans=(ans*a)%m;
		b/=2;
		a=(a*a)%m;
	}
	return ans;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	ll n,m;cin>>n>>m;
	ll a[n+2];
	vii v[2];
	rep(i,1,m+1)
	{
		ll aa,b,c;cin>>aa>>b>>c;
		/*if(m==906 and i==443)
			test3(aa,b,c);*/
		v[aa].pb({b,c});
	}
	sort(all(v[0]));
	sort(all(v[1]));

	if(v[1].size()==0)
	{
		cout<<"YES"<<endl;
		ll x=1e7;
		rep(i,1,n+1)
			cout<<x--<<" ";nl;
		return 0;
	}
	rep(i,1,n+1)
	a[i]=0;

	pii merged[n+2];
	merged[1]={v[1][0].ff,v[1][0].ss};
	ll ind=1;
	rep(i,1,v[1].size())
	{
		if(merged[ind].ss >= v[1][i].ff){
			merged[ind]={min(merged[ind].ff,v[1][i].ff),max(merged[ind].ss,v[1][i].ss)};
			//test3("yayay",merged[ind].ff,merged[ind].ss);
		}
		else{
			ind++;
			merged[ind]={v[1][i].ff,v[1][i].ss};
		}
	}
	/*rep(i,1,ind+1)
		test2(merged[i].ff,merged[i].ss);*/
	ll curr=1e7;
	rep(i,1,ind+1)
	{
		//test2(merged[i].ff,merged[i].ss);
		rep(j,merged[i].ff,merged[i].ss+1)
			a[j]=curr;
		curr--;
	}
	curr=1;
	/*if(m==906)
	rep(j,101,109)
		cout<<a[j]<<" ";nl;*/
	rep(j,1,n+1)
		if(!a[j])
			a[j]=curr++;
	/*rep(i,1,n+1)
		cout<<a[i]<<" ";nl;*/
	bool flag=0;
	rep(i,0,v[0].size())
	{
		flag=0;
		rep(j,v[0][i].ff+1,v[0][i].ss+1)
			if(a[j-1]>a[j])
				flag=1;
		if(flag==0)
		{
			cout<<"NO"<<endl;
			return 0;
		}
	}
	/*if(flag or v[0].size()==0)
	{*/
		cout<<"YES"<<endl;
		rep(i,1,n+1)
			cout<<a[i]<<" ";nl;
	/*}
	else
		cout<<"NO"<<endl;*/

}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define nl cout<<endl

#define pii pair<ll,ll>
#define vi  vector<ll>
#define vii vector<pii>
#define mi  map<ll,ll>
#define all(a)  (a).begin(),(a).end()

#define pb push_back
#define ff first
#define ss second
#define hell 1000000007

#define test4(x,y,z,a) cout<<"x is "<<x<<"		y is "<<y<<"		z is "<<z<<"		a is "<<a<<endl;
#define test3(x,y,z) cout<<"x is "<<x<<"		y is "<<y<<"		z is "<<z<<endl;
#define test2(x,y) cout<<"x is "<<x<<"		y is "<<y<<endl;
#define test1(x) cout<<"x is "<<x<<endl;
#define N 300009

ll power(ll a,ll b,ll m)
{
	ll ans=1;
	while(b)
	{
		if(b&1)
			ans=(ans*a)%m;
		b/=2;
		a=(a*a)%m;
	}
	return ans;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	ll n,m;cin>>n>>m;
	ll a[n+2];
	vii v[2];
	rep(i,1,m+1)
	{
		ll aa,b,c;cin>>aa>>b>>c;
		/*if(m==906 and i==443)
			test3(aa,b,c);*/
		v[aa].pb({b,c});
	}
	sort(all(v[0]));
	sort(all(v[1]));

	if(v[1].size()==0)
	{
		cout<<"YES"<<endl;
		ll x=1e7;
		rep(i,1,n+1)
			cout<<x--<<" ";nl;
		return 0;
	}
	rep(i,0,n+2)
	a[i]=0;

	pii merged[n+2];
	merged[1]={v[1][0].ff,v[1][0].ss};
	ll ind=1;
	rep(i,1,v[1].size())
	{
		if(merged[ind].ss >= v[1][i].ff){
			merged[ind]={min(merged[ind].ff,v[1][i].ff),max(merged[ind].ss,v[1][i].ss)};
			//test3("yayay",merged[ind].ff,merged[ind].ss);
		}
		else{
			ind++;
			merged[ind]={v[1][i].ff,v[1][i].ss};
		}
	}
	/*rep(i,1,ind+1)
		test2(merged[i].ff,merged[i].ss);*/
	ll curr=1e7;
	rep(i,1,ind+1)
	{
		//test2(merged[i].ff,merged[i].ss);
		rep(j,merged[i].ff,merged[i].ss+1)
			a[j]=curr;
		curr--;
	}
	curr=1;
	/*if(m==906)
	rep(j,101,109)
		cout<<a[j]<<" ";nl;*/

	/*rep(j,1,n+1)
		if(!a[j])
			a[j]=curr++;*/

		/*rep(i,1,n+1)
		cout<<a[i]<<" ";nl;*/

	curr=1e9;
	rep(i,0,v[0].size())
	{
		bool flag=1;
		rep(j,v[0][i].ff,v[0][i].ss+1)
		{
			if(a[j]==0 and a[j+1]!=0 and j+1<=v[0][i].ss and j+1<=n)
				a[j]=a[j+1]+1;
			else if(a[j]==0 and a[j-1]!=0 and j-1>=v[0][i].ff and j-1>=1)
				a[j]=a[j-1]-1;
			else
				flag=0;
		}
		if(flag==0)
			rep(j,v[0][i].ff,v[0][i].ss+1)
				if(!a[j])
					a[j]=curr--;
	}
	/*rep(i,1,n+1)
		if(!a[i])
			a[i]=1e9;*/
	/*rep(i,1,n+1)
		cout<<a[i]<<" ";nl;*/
	bool flag=0;
	rep(i,0,v[0].size())
	{
		flag=0;
		rep(j,v[0][i].ff+1,v[0][i].ss+1)
			if(a[j-1]>a[j])
				flag=1;
		if(flag==0)
		{
			cout<<"NO"<<endl;
			return 0;
		}
	}
	/*if(flag or v[0].size()==0)
	{*/
		cout<<"YES"<<endl;
		rep(i,1,n+1)
			cout<<a[i]<<" ";nl;
	/*}
	else
		cout<<"NO"<<endl;*/

}


//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 INT_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 INT_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<int>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

bool sortbysec(const pair<int,pair<int,int>> &a,const pair<int,pair<int,int>> &b)
{

  if(a.first == b.first)
      return (a.second.first >= b.second.first);
  else
     return (a.first < b.first);
}

int main()
{

  int n,m,i,a,b,c,num,j,u,v;
  cin>>n>>m;

  int A[n+1]={0},M[n+1]={0};

if((n==600)||(m==600))
  {
    cout<<"Here0\n";
  }

  pair<int,pair<int,int>> p[m];

 if((n==600)||(m==600))
  {
    cout<<"Here1\n";
    cout<<m<<"\n";
  }

  for(i=0;i<m;++i)
  {
      cin>>a>>b>>c;
      p[i] = {a,{b,c}};
  }

if((n==600)||(m==600))
  {
    cout<<"Here2\n";
  }

  sort(p,p+m,sortbysec);

  i=m-1;
  while(i>=0 && (p[i].first!=0))
  {
    b = p[i].second.first;
    c = p[i].second.second;

    for(j=b;j<=c;++j)
      A[j]=-1;

   // cout<<b<<" "<<c<<"\n";

    if(i!=(m-1))
    {
        if((b-1)==v)
          M[b]=1;
    }
    u = b , v = c;
    --i;
  }

  num = 30000;
  j=i;

  int B[n+1]={0};

  rep(i,0,n+1)
    B[i]=A[i];

  for(i=1;i<=n;++i)
  {

      if(i>1)
      {
         if((B[i-1]==0) || (B[i]==0))
          --num;
      }

      if(M[i])
        --num;

      A[i] = num;
  }

  i=j;

  for(;i>=0;--i)
  {
      b = p[i].second.first;
      c = p[i].second.second;

      for(j=b+1;j<=c;++j)
      {
          if(A[j]<A[j-1])
            break;
      }

      if(j>c)
      {
         cout<<"NO\n";
         return 0;
      }
  }

  cout<<"YES\n";

  rep(i,1,n+1)
    cout<<A[i]<<" ";

  cout<<"\n";

  return 0;
}


//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 INT_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 INT_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<int>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

bool sortbysec(const pair<int,pair<int,int>> &a,const pair<int,pair<int,int>> &b)
{

  if(a.first == b.first)
      return (a.second.first >= b.second.first);
  else
     return (a.first < b.first);
}

int main()
{

  int n,m,i,a,b,c,num,j,u,v;
  cin>>n>>m;

  int A[n+1]={0},M[n+1]={0};

if((n==600)||(m==600))
  {
    cout<<"Here0\n";
  }

  pair<int,pair<int,int>> p[m];

 if((n==600)||(m==600))
  {
    cout<<"Here1\n";
    cout<<m<<"\n";
  }

  for(i=0;i<m;++i)
  {
      cin>>a>>b>>c;

      if(i==599 && (m==600))
          cout<<"there\n";

      p[i] = {a,{b,c}};
  }

if((n==600)||(m==600))
  {
    cout<<"Here2\n";
  }

  sort(p,p+m,sortbysec);

  i=m-1;
  while(i>=0 && (p[i].first!=0))
  {
    b = p[i].second.first;
    c = p[i].second.second;

    for(j=b;j<=c;++j)
      A[j]=-1;

   // cout<<b<<" "<<c<<"\n";

    if(i!=(m-1))
    {
        if((b-1)==v)
          M[b]=1;
    }
    u = b , v = c;
    --i;
  }

  num = 30000;
  j=i;

  int B[n+1]={0};

  rep(i,0,n+1)
    B[i]=A[i];

  for(i=1;i<=n;++i)
  {

      if(i>1)
      {
         if((B[i-1]==0) || (B[i]==0))
          --num;
      }

      if(M[i])
        --num;

      A[i] = num;
  }

  i=j;

  for(;i>=0;--i)
  {
      b = p[i].second.first;
      c = p[i].second.second;

      for(j=b+1;j<=c;++j)
      {
          if(A[j]<A[j-1])
            break;
      }

      if(j>c)
      {
         cout<<"NO\n";
         return 0;
      }
  }

  cout<<"YES\n";

  rep(i,1,n+1)
    cout<<A[i]<<" ";

  cout<<"\n";

  return 0;
}


//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 INT_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 INT_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<int>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

bool sortbysec(const pair<int,pair<int,int>> &a,const pair<int,pair<int,int>> &b)
{

  if(a.first == b.first)
      return (a.second.first >= b.second.first);
  else
     return (a.first < b.first);
}

int main()
{

  int n,m,i,a,b,c,num,j,u,v;
  cin>>n>>m;

  int A[n+1]={0},M[n+1]={0};

  pair<int,pair<int,int>> p[m];

  for(i=0;i<m;++i)
  {
      cin>>a>>b>>c;
      p[i] = {a,{b,c}};
  }

  sort(p,p+m,sortbysec);

  i=m-1;
  while(i>=0 && (p[i].first!=0))
  {
    b = p[i].second.first;
    c = p[i].second.second;

    for(j=b;j<=c;++j)
      A[j]=-1;

   // cout<<b<<" "<<c<<"\n";

    if(i!=(m-1))
    {
        if(b>v)
          M[b]=1;
    }
    u = b , v = c;
    --i;
  }

  num = 30000;
  j=i;

  int B[n+1]={0};

  rep(i,0,n+1)
    B[i]=A[i];

  for(i=1;i<=n;++i)
  {

      if(i>1)
      {
         if(B[i-1]==0)
          --num;
      }

      if(M[i])
        --num;

      A[i] = num;
  }

  i=j;
  for(;i>=0;--i)
  {
      b = p[i].second.first;
      c = p[i].second.second;

      for(j=b+1;j<=c;++j)
      {
          if(A[j]<A[j-1])
            break;
      }

      if(j>c)
      {
         cout<<"NO\n";
         return 0;
      }
  }

  cout<<"YES\n";

  rep(i,1,n+1)
    cout<<A[i]<<" ";

  cout<<"\n";

  return 0;
}


//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 INT_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 INT_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<int>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

bool sortbysec(const pair<int,pair<int,int>> &a,const pair<int,pair<int,int>> &b)
{

  if(a.first == b.first)
      return (a.second.first > b.second.first);
  else
     return (a.first < b.first);
}

int main()
{

  int n,m,i,a,b,c,num,j,u,v;
  cin>>n>>m;

  int A[n+1]={0},M[n+1]={0};

  pair<int,pair<int,int>> p[m];

  for(i=0;i<m;++i)
  {
      cin>>a>>b>>c;
      p[i] = {a,{b,c}};
  }

  sort(p,p+m,sortbysec);

  i=m-1;
  while(i>=0 && (p[i].first!=0))
  {
    b = p[i].second.first;
    c = p[i].second.second;

    for(j=b;j<=c;++j)
      A[j]=-1;

   // cout<<b<<" "<<c<<"\n";

    if(i!=(m-1))
    {
        if(b>v)
          M[b]=1;
    }
    u = b , v = c;
    --i;
  }

  num = 30000;
  j=i;

  int B[n+1]={0};

  rep(i,0,n+1)
    B[i]=A[i];

  for(i=1;i<=n;++i)
  {

      if(i>1)
      {
         if(B[i-1]==0)
          --num;
      }

      if(M[i])
        --num;

      A[i] = num;
  }

  i=j;
  for(;i>=0;--i)
  {
      b = p[i].second.first;
      c = p[i].second.second;

      for(j=b+1;j<=c;++j)
      {
          if(A[j]<A[j-1])
            break;
      }

      if(j>c)
      {
         cout<<"NO\n";
         return 0;
      }
  }

  cout<<"YES\n";

  rep(i,1,n+1)
    cout<<A[i]<<" ";

  cout<<"\n";

  return 0;
}


//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 INT_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 INT_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<int>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
bool sortbysec(const pair<int,pair<int,int>> &a,const pair<int,pair<int,int>> &b)
{

  if(a.first == b.first)
      return (a.second.first >= b.second.first);
  else
     return (a.first < b.first);
}

int main()
{

  int n,m,i,a,b,c,j;
  cin>>n>>m;

  pair<int,pair<int,int>> A[m];

  int ans[n+1],mark[n+1];

  rep(i,1,n+1)
    mark[i] = -1;

  for(i=0;i<m;++i)
  {

      cin>>a>>b>>c;
      //cin>>A[i].first>>A[i].second.first>>A[i].second.second;
      A[i] = {a,{b,c};

  }

  rep(i,0,m)
  {
     if(A[i].first == 1)
          for(j=A[i].second.first;j<A[i].second.second;++j)
              mark[j] = 0;
  }

  sort(A,A+m,sortbysec);

  ans[1] = n;

  for(i=2;i<=n;++i)
      ans[i] =ans[i-1] +  mark[i-1];

  for(i=0;i<m;++i)
  {
      if(A[i].first==0)
      {
          for(j=A[i].second.first+1;j<=A[i].second.second;++j)
          {
              if(ans[j]<ans[j-1])
                  break;
          }

          if(j>A[i].second.second)
          {
            cout<<"NO\n";
            return 0;
          }
      }
  }

  cout<<"YES\n";

  for(i=1;i<=n;++i)
      cout<<ans[i]<<" ";

  cout<<"\n";

  return 0;
}


//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 INT_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 INT_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<int>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

bool sortbysec(const pair<int,pair<int,int>> &a,const pair<int,pair<int,int>> &b)
{

  if(a.first == b.first)
      return (a.second.first > b.second.first);
  else
     return (a.first < b.first);
}

int main()
{

  int n,m,i,a,b,c,j;
  cin>>n>>m;

  pair<int,pair<int,int>> A[m];

  int ans[n+1],mark[n+1];

  rep(i,1,n+1)
    mark[i] = -1;

  for(i=0;i<m;++i)
  {

      cin>>a>>b>>c;
      //cin>>A[i].first>>A[i].second.first>>A[i].second.second;
      A[i] = {a,{b,c}};

  }

  rep(i,0,m)
  {
     if(A[i].first == 1)
          for(j=A[i].second.first;j<A[i].second.second;++j)
              mark[j] = 0;
  }

  sort(A,A+m,sortbysec);

  ans[1] = n;

  for(i=2;i<=n;++i)
      ans[i] =ans[i-1] +  mark[i-1];

  for(i=0;i<m;++i)
  {
      if(A[i].first==0)
      {
          for(j=A[i].second.first+1;j<=A[i].second.second;++j)
          {
              if(ans[j]<ans[j-1])
                  break;
          }

          if(j>A[i].second.second)
          {
            cout<<"NO\n";
            return 0;
          }
      }
  }

  cout<<"YES\n";

  for(i=1;i<=n;++i)
      cout<<ans[i]<<" ";

  cout<<"\n";

  return 0;
}


//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 INT_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 INT_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<int>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

/*bool sortbysec(const pair<int,pair<int,int>> &a,const pair<int,pair<int,int>> &b)
{

  if(a.first == b.first)
      return (a.second.first >= b.second.first);
  else
     return (a.first < b.first);
} */

int main()
{

  int n,m,i,a,b,c,j;
  cin>>n>>m;

  pair<int,pair<int,int>> A[m];

  int ans[n+1],mark[n+1];

  rep(i,1,n+1)
    mark[i] = -1;

  for(i=0;i<m;++i)
  {

      cin>>a>>b>>c;
      //cin>>A[i].first>>A[i].second.first>>A[i].second.second;
      A[i] = {a,{b,c}};

  }

  rep(i,0,m)
  {
     if(A[i].first == 1)
          for(j=A[i].second.first;j<A[i].second.second;++j)
              mark[j] = 0;
  }

  sort(A,A+m);

  ans[1] = n;

  for(i=2;i<=n;++i)
      ans[i] =ans[i-1] +  mark[i-1];

  for(i=0;i<m;++i)
  {
      if(A[i].first==0)
      {
          for(j=A[i].second.first+1;j<=A[i].second.second;++j)
          {
              if(ans[j]<ans[j-1])
                  break;
          }

          if(j>A[i].second.second)
          {
            cout<<"NO\n";
            return 0;
          }
      }
  }

  cout<<"YES\n";

  for(i=1;i<=n;++i)
      cout<<ans[i]<<" ";

  cout<<"\n";

  return 0;
}


//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 INT_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 INT_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<int>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

bool sortbysec(const pair<int,pair<int,int>> &a,const pair<int,pair<int,int>> &b)
{

  if(a.first == b.first)
      return (a.second.first >= b.second.first);
  else
     return (a.first < b.first);
}

int main()
{

  int n,m,i,a,b,c,num,j,u,v;
  cin>>n>>m;

  int A[n+1]={0},M[n+1]={0};

  pair<int,pair<int,int>> p[m];

  for(i=0;i<m;++i)
  {
      cin>>a>>b>>c;
      p[i] = {a,{b,c}};
  }

   if((n==600)||(m==600))
  {
    cout<<"Here\n";
  }

  sort(p,p+m,sortbysec);

  i=m-1;
  while(i>=0 && (p[i].first!=0))
  {
    b = p[i].second.first;
    c = p[i].second.second;

    for(j=b;j<=c;++j)
      A[j]=-1;

   // cout<<b<<" "<<c<<"\n";

    if(i!=(m-1))
    {
        if((b-1)==v)
          M[b]=1;
    }
    u = b , v = c;
    --i;
  }

  num = 30000;
  j=i;

  int B[n+1]={0};

  rep(i,0,n+1)
    B[i]=A[i];

  for(i=1;i<=n;++i)
  {

      if(i>1)
      {
         if((B[i-1]==0) || (B[i]==0))
          --num;
      }

      if(M[i])
        --num;

      A[i] = num;
  }

  i=j;

  for(;i>=0;--i)
  {
      b = p[i].second.first;
      c = p[i].second.second;

      for(j=b+1;j<=c;++j)
      {
          if(A[j]<A[j-1])
            break;
      }

      if(j>c)
      {
         cout<<"NO\n";
         return 0;
      }
  }

  cout<<"YES\n";

  rep(i,1,n+1)
    cout<<A[i]<<" ";

  cout<<"\n";

  return 0;
}


//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 INT_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 INT_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<int>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

bool sortbysec(const pair<int,pair<int,int>> &a,const pair<int,pair<int,int>> &b)
{

  if(a.first == b.first)
      return (a.second.first >= b.second.first);
  else
     return (a.first < b.first);
}

int main()
{

  int n,m,i,a,b,c,num,j,u,v;
  cin>>n>>m;

  int A[n+1]={0},M[n+1]={0};

if((n==600)||(m==600))
  {
    cout<<"Here0\n";
  }

  pair<int,pair<int,int>> p[m+1];

 if((n==600)||(m==600))
  {
    cout<<"Here1\n";
    cout<<m<<"\n";
  }

  for(i=0;i<m;++i)
  {
      cin>>a>>b>>c;

      if(i==599 && (m==600))
          cout<<"there\n";

      p[i] = {a,{b,c}};
  }

if((n==600)||(m==600))
  {
    cout<<"Here2\n";
  }

  sort(p,p+m,sortbysec);

  i=m-1;
  while(i>=0 && (p[i].first!=0))
  {
    b = p[i].second.first;
    c = p[i].second.second;

    for(j=b;j<=c;++j)
      A[j]=-1;

   // cout<<b<<" "<<c<<"\n";

    if(i!=(m-1))
    {
        if((b-1)==v)
          M[b]=1;
    }
    u = b , v = c;
    --i;
  }

  num = 30000;
  j=i;

  int B[n+1]={0};

  rep(i,0,n+1)
    B[i]=A[i];

  for(i=1;i<=n;++i)
  {

      if(i>1)
      {
         if((B[i-1]==0) || (B[i]==0))
          --num;
      }

      if(M[i])
        --num;

      A[i] = num;
  }

  i=j;

  for(;i>=0;--i)
  {
      b = p[i].second.first;
      c = p[i].second.second;

      for(j=b+1;j<=c;++j)
      {
          if(A[j]<A[j-1])
            break;
      }

      if(j>c)
      {
         cout<<"NO\n";
         return 0;
      }
  }

  cout<<"YES\n";

  rep(i,1,n+1)
    cout<<A[i]<<" ";

  cout<<"\n";

  return 0;
}


//To debug :  g++ -g file.cpp -o code
//to flush output : fflush(stdout) or cout.flush()
//cout<<setprecision(p)<<fixed<<var
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,n) for(i=a;i<n;++i)
#define irep(i,n,a) for(i=n;i>a;--i)
#define mod 1000000007
#define pb push_back
#define big 9223372036854775807
#define big1 LONG_MAX
#define big2 INT_MAX
#define big3 1000000000
#define sma1 LONG_MIN
#define sma2 INT_MIN
#define sma3 -1000000000
#define mp make_pair
#define dub double
#define ivec vector<int>
#define lvec vector<long long>
#define cvec vector<char>
#define svec vector<string>
#define mt make_tuple
#define MOD 998244353
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

  pair<int,pair<int,int>> p[2000];

bool sortbysec(const pair<int,pair<int,int>> &a,const pair<int,pair<int,int>> &b)
{

  if(a.first == b.first)
      return (a.second.first >= b.second.first);
  else
     return (a.first < b.first);
}

int main()
{

  int n,m,i,a,b,c,num,j,u,v;
  cin>>n>>m;

  int A[n+1]={0},M[n+1]={0};

/*
if((n==600)||(m==600))
  {
    cout<<"Here0\n";
  }
*/
/*
 if((n==600)||(m==600))
  {
    cout<<"Here1\n";
    cout<<m<<"\n";
  }
*/

  for(i=0;i<m;++i)
  {
    cin>>p[i].first>>p[i].second.first>>p[i].second.second;
  }

/*if((n==600)||(m==600))
  {
    cout<<"Here2\n";
  }
*/

  sort(p,p+m,sortbysec);

  i=m-1;
  while(i>=0 && (p[i].first!=0))
  {
    b = p[i].second.first;
    c = p[i].second.second;

    for(j=b;j<=c;++j)
      A[j]=-1;

   // cout<<b<<" "<<c<<"\n";

    if(i!=(m-1))
    {
        if((b-1)==v)
          M[b]=1;
    }
    u = b , v = c;
    --i;
  }

  num = 30000;
  j=i;

  int B[n+1]={0};

  rep(i,0,n+1)
    B[i]=A[i];

  for(i=1;i<=n;++i)
  {

      if(i>1)
      {
         if((B[i-1]==0) || (B[i]==0))
          --num;
      }

      if(M[i])
        --num;

      A[i] = num;
  }

  i=j;

  for(;i>=0;--i)
  {
      b = p[i].second.first;
      c = p[i].second.second;

      for(j=b+1;j<=c;++j)
      {
          if(A[j]<A[j-1])
            break;
      }

      if(j>c)
      {
         cout<<"NO\n";
         return 0;
      }
  }

  cout<<"YES\n";

  rep(i,1,n+1)
    cout<<A[i]<<" ";

  cout<<"\n";

  return 0;
}


#include<bits/stdc++.h>
#define f first
#define s second
#define mp make_pair
#define pb push_back
using namespace std;
vector<vector<int> > g;
vector<pair<pair<int,int>,int> > all;
queue <int> q;
int cf[55][55], dist[55], s = 1, t;
bool bfs(){
	q.push(s);
	while (q.size()){
		int v = q.front();
		q.pop();
		if(v == t) {
			while (q.size()) q.pop();
			return 1;
		}
		for (int i = 0; i < g[v].size(); i ++){
			int u = g[v][i];
			if(dist[u] or !cf[v][u] or u == s) continue;
			dist[u] = dist[v] + 1;

			if (u == t){
				while (q.size()) q.pop();
				return 1;
			}
			q.push (u);
		}
	}
	return 0;
}
int dfs(int v, int ile)
{
// 	printf("dfs %d %d\n", v, ile);
	int ans = 0;
	if(!ile or v == t) return ile;
	for(int i = 0; i < g[v].size(); i ++){
		int u = g[v][i];
		if(dist[u] == dist[v] + 1 and cf[v][u]){
			int x = min (ile, cf[v][u]);
			int y = dfs(u, x);
			ans += y;
			ile -= y;
			cf[v][u] -= y;
			cf[u][v] += y;
// 			printf("cf[%d][%d] = %d\n", v, u, cf[v][u]);
		}
		if(!ile)return ans;
	}
// 	printf("dfs %d %d: ans = %d\n", v, ile, ans);
	return ans;
}
int main (){
	int n, m, x;
	scanf ("%d %d %d", &n, &m, &x);
	t = n;
	g.resize(n + 1);
	while (m --){
		int a, b, c;
		scanf ("%d %d %d", &a, &b, &c);
		all.pb(mp(mp(a,b),c));
		g[a].pb(b);
		g[b].pb(a);
	}
	long double p = 0, k = 1000001;
	long double eps = 10e-15;
	while(k - p > eps){
		long double flow = (k + p) / 2;
//  		printf("flow %.7Lf\n", flow);
		for (auto e : all){
			cf[e.f.f][e.f.s] = (1.0 * e.s / flow);
// 			printf(".cf[%d][%d] = %d\n", e.f.f, e.f.s, cf[e.f.f][e.f.s]);
		}
		int ans = 0;
		while (bfs())
		{
			ans += dfs (s, 1000005);
			for (int i = 1; i <= n; i ++) dist[i] = 0;
//  			printf("ans %d\n", ans);
		}
		for (int i = 1; i <= n; i ++) dist[i] = 0;
		if(ans >= x) p = flow;
		else k = flow;
		for (auto e : all){
			cf[e.f.f][e.f.s] = 0;
			cf[e.f.s][e.f.f] = 0;
		}

	}
	printf("%.7Lf\n", 1.0L * p * x);
	return 0;
}


#include<bits/stdc++.h>
#define f first
#define s second
#define mp make_pair
#define pb push_back
using namespace std;
vector<vector<int> > g;
vector<pair<pair<int,int>,int> > all;
queue <int> q;
int cf[55][55], dist[55], s = 1, t;
bool bfs(){
	q.push(s);
	while (q.size()){
		int v = q.front();
		q.pop();
		if(v == t) {
			while (q.size()) q.pop();
			return 1;
		}
		for (int i = 0; i < g[v].size(); i ++){
			int u = g[v][i];
			if(dist[u] or !cf[v][u] or u == s)continue;
			dist[u] = dist[v] + 1;
			if (u == t){
				while (q.size()) q.pop();
				return 1;
			}
			q.push (u);
		}
	}
	return 0;
}
int dfs(int v, int ile)
{
// 	printf("dfs %d %d\n", v, ile);
	int ans = 0;
	if(!ile or v == t) return ile;
	for(int i = 0; i < g[v].size(); i ++){
		int u = g[v][i];
		if(dist[u] == dist[v] + 1 and cf[v][u]){
			int x = min (ile, cf[v][u]);
			int y = dfs(u, x);
			ans += y;
			ile -= y;
			cf[v][u] -= y;
			cf[u][v] += y;
// 			printf("cf[%d][%d] = %d\n", v, u, cf[v][u]);
		}
		if(!ile)return ans;
	}
// 	printf("dfs %d %d: ans = %d\n", v, ile, ans);
	return ans;
}
int main (){
	int n, m, x;
	scanf ("%d %d %d", &n, &m, &x);
	t = n;
	g.resize(n + 1);
	while (m --){
		int a, b, c;
		scanf ("%d %d %d", &a, &b, &c);
		all.pb(mp(mp(a,b),c));
		g[a].pb(b);
		g[b].pb(a);
	}
	long double p = 0, k = 1000001;
	long double eps = 10e-12;
	while(k - p > eps){
		long double flow = (k + p) / 2;
// 		if(flow < 1.0) printf("flow %.7lf\n", flow);
		for (auto e : all){
			cf[e.f.f][e.f.s] = (int)(1.0 * e.s / flow);
// 			if(flow < 1.0) printf(".cf[%d][%d] = %d\n", e.f.f, e.f.s, cf[e.f.f][e.f.s]);
			cf[e.f.s][e.f.f] = 0;
		}

		int ans = 0;
		while (bfs())
		{
			ans += dfs (s, 1000005);
			for (int i = 1; i <= n; i ++) dist[i] = 0;
// 			printf("ans %d\n", ans);
		}
		for (int i = 1; i <= n; i ++) dist[i] = 0;
		if(ans >= x) p = flow;
		else k = flow;
	}
	printf("%.7Lf\n", 1.0L * p * x);
	return 0;
}


#include<bits/stdc++.h>
#define f first
#define s second
#define mp make_pair
#define pb push_back
using namespace std;
vector<vector<int> > g;
vector<pair<pair<int,int>,int> > all;
queue <int> q;
int cf[55][55], dist[55], s = 1, t;
bool bfs(){
	q.push(s);
	while (q.size()){
		int v = q.front();
		q.pop();
		if(v == t) {
			while (q.size()) q.pop();
			return 1;
		}
		for (int i = 0; i < g[v].size(); i ++){
			int u = g[v][i];
			if(dist[u] or !cf[v][u] or u == s) continue;
			dist[u] = dist[v] + 1;

			if (u == t){
				while (q.size()) q.pop();
				return 1;
			}
			q.push (u);
		}
	}
	return 0;
}
int dfs(int v, int ile)
{
// 	printf("dfs %d %d\n", v, ile);
	int ans = 0;
	if(!ile or v == t) return ile;
	for(int i = 0; i < g[v].size(); i ++){
		int u = g[v][i];
		if(dist[u] == dist[v] + 1 and cf[v][u]){
			int x = min (ile, cf[v][u]);
			int y = dfs(u, x);
			ans += y;
			ile -= y;
			cf[v][u] -= y;
			cf[u][v] += y;
// 			printf("cf[%d][%d] = %d\n", v, u, cf[v][u]);
		}
		if(!ile)return ans;
	}
// 	printf("dfs %d %d: ans = %d\n", v, ile, ans);
	return ans;
}
int main (){
	int n, m, x;
	scanf ("%d %d %d", &n, &m, &x);
	t = n;
	g.resize(n + 1);
	while (m --){
		int a, b, c;
		scanf ("%d %d %d", &a, &b, &c);
		all.pb(mp(mp(a,b),c*100));
		g[a].pb(b);
		g[b].pb(a);
	}
	long double p = 0, k = 100000001;
	long double eps = 10e-12;
	while(k - p > eps){
		long double flow = (k + p) / 2;
//  		printf("flow %.7Lf\n", flow);
		for (auto e : all){
			if(flow < e.s / x)
				cf[e.f.f][e.f.s] = x;
			else
				cf[e.f.f][e.f.s] = (1.0L * e.s / flow);
// 			printf(".cf[%d][%d] = %d\n", e.f.f, e.f.s, cf[e.f.f][e.f.s]);
		}
		int ans = 0;
		while (bfs())
		{
			ans += dfs (s, 1000000005);
			for (int i = 1; i <= n; i ++) dist[i] = 0;
//  			printf("ans %d\n", ans);
		}
		for (int i = 1; i <= n; i ++) dist[i] = 0;
		if(ans >= x) p = flow;
		else k = flow;
		for (auto e : all){
			cf[e.f.f][e.f.s] = 0;
			cf[e.f.s][e.f.f] = 0;
		}

	}
	printf("%.7Lf\n", 1.0L * p * x / 100);
	return 0;
}


#include<bits/stdc++.h>
#define f first
#define s second
#define mp make_pair
#define pb push_back
using namespace std;
vector<vector<int> > g;
vector<pair<pair<int,int>,int> > all;
queue <int> q;
int cf[55][55], dist[55], s = 1, t;
bool bfs(){
	q.push(s);
	while (q.size()){
		int v = q.front();
		q.pop();
		if(v == t) {
			while (q.size()) q.pop();
			return 1;
		}
		for (int i = 0; i < g[v].size(); i ++){
			int u = g[v][i];
			if(dist[u] or !cf[v][u] or u == s) continue;
			dist[u] = dist[v] + 1;

			if (u == t){
				while (q.size()) q.pop();
				return 1;
			}
			q.push (u);
		}
	}
	return 0;
}
int dfs(int v, int ile)
{
// 	printf("dfs %d %d\n", v, ile);
	int ans = 0;
	if(!ile or v == t) return ile;
	for(int i = 0; i < g[v].size(); i ++){
		int u = g[v][i];
		if(dist[u] == dist[v] + 1 and cf[v][u]){
			int x = min (ile, cf[v][u]);
			int y = dfs(u, x);
			ans += y;
			ile -= y;
			cf[v][u] -= y;
			cf[u][v] += y;
// 			printf("cf[%d][%d] = %d\n", v, u, cf[v][u]);
		}
		if(!ile)return ans;
	}
// 	printf("dfs %d %d: ans = %d\n", v, ile, ans);
	return ans;
}
int main (){
	int n, m, x;
	scanf ("%d %d %d", &n, &m, &x);
	t = n;
	g.resize(n + 1);
	while (m --){
		int a, b, c;
		scanf ("%d %d %d", &a, &b, &c);
		all.pb(mp(mp(a,b),c*100));
		g[a].pb(b);
		g[b].pb(a);
	}
	long double p = 0, k = 100000001;
	long double eps = 10e-12;
	while(k - p > eps){
		long double flow = (k + p) / 2;
//  		printf("flow %.7Lf\n", flow);
		for (auto e : all){
			cf[e.f.f][e.f.s] = (1.0 * e.s / flow);
// 			printf(".cf[%d][%d] = %d\n", e.f.f, e.f.s, cf[e.f.f][e.f.s]);
		}
		int ans = 0;
		while (bfs())
		{
			ans += dfs (s, 1000005);
			for (int i = 1; i <= n; i ++) dist[i] = 0;
//  			printf("ans %d\n", ans);
		}
		for (int i = 1; i <= n; i ++) dist[i] = 0;
		if(ans >= x) p = flow;
		else k = flow;
		for (auto e : all){
			cf[e.f.f][e.f.s] = 0;
			cf[e.f.s][e.f.f] = 0;
		}

	}
	printf("%.7Lf\n", 1.0L * p * x / 100);
	return 0;
}


#include<bits/stdc++.h>
#define f first
#define s second
#define mp make_pair
#define pb push_back
using namespace std;
vector<vector<int> > g;
vector<pair<pair<int,int>,int> > all;
queue <int> q;
int cf[55][55], dist[55], s = 1, t;
bool bfs(){
	q.push(s);
	while (q.size()){
		int v = q.front();
		q.pop();
		if(v == t) {
			while (q.size()) q.pop();
			return 1;
		}
		for (int i = 0; i < g[v].size(); i ++){
			int u = g[v][i];
			if(dist[u] or !cf[v][u] or u == s) continue;
			dist[u] = dist[v] + 1;

			if (u == t){
				while (q.size()) q.pop();
				return 1;
			}
			q.push (u);
		}
	}
	return 0;
}
int dfs(int v, int ile)
{
// 	printf("dfs %d %d\n", v, ile);
	int ans = 0;
	if(!ile or v == t) return ile;
	for(int i = 0; i < g[v].size(); i ++){
		int u = g[v][i];
		if(dist[u] == dist[v] + 1 and cf[v][u]){
			int x = min (ile, cf[v][u]);
			int y = dfs(u, x);
			ans += y;
			ile -= y;
			cf[v][u] -= y;
			cf[u][v] += y;
// 			printf("cf[%d][%d] = %d\n", v, u, cf[v][u]);
		}
		if(!ile)return ans;
	}
// 	printf("dfs %d %d: ans = %d\n", v, ile, ans);
	return ans;
}
int main (){
	int n, m, x;
	scanf ("%d %d %d", &n, &m, &x);
	t = n;
	g.resize(n + 1);
	while (m --){
		int a, b, c;
		scanf ("%d %d %d", &a, &b, &c);
		all.pb(mp(mp(a,b),c));
		g[a].pb(b);
		g[b].pb(a);
	}
	long double p = 0, k = 1000001;
	long double eps = 10e-12;
	while(k - p > eps){
		long double flow = (k + p) / 2;
//  		printf("flow %.7Lf\n", flow);
		for (auto e : all){
			cf[e.f.f][e.f.s] = (1.0 * e.s / flow);
// 			printf(".cf[%d][%d] = %d\n", e.f.f, e.f.s, cf[e.f.f][e.f.s]);
		}
		int ans = 0;
		while (bfs())
		{
			ans += dfs (s, 1000005);
			for (int i = 1; i <= n; i ++) dist[i] = 0;
//  			printf("ans %d\n", ans);
		}
		for (int i = 1; i <= n; i ++) dist[i] = 0;
		if(ans >= x) p = flow;
		else k = flow;
		for (auto e : all){
			cf[e.f.f][e.f.s] = 0;
			cf[e.f.s][e.f.f] = 0;
		}

	}
	printf("%.7Lf\n", 1.0L * p * x);
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

struct edge
{
	ll from, to, cap, flow, index;
	edge(ll from, ll to, ll cap, ll flow, ll index):
		from(from), to(to), cap(cap), flow(flow), index(index) {}
};

struct dicin
{
	ll n;
	vector<vector<edge> > g;
	vector<long long> excess;
	vector<ll> height, active, count;
	queue<ll> Q;

	dicin(ll n):
		n(n), g(n), excess(n), height(n), active(n), count(2*n) {}

	void addEdge(ll from, ll to, ll cap)
	{
		g[from].push_back(edge(from, to, cap, 0, g[to].size()));
		if(from==to)
			g[from].back().index++;
		g[to].push_back(edge(to, from, 0, 0, g[from].size()-1));
	}

	void enqueue(ll v)
	{
		if(!active[v] && excess[v] > 0)
		{
			active[v]=true;
			Q.push(v);
		}
	}

	void push(edge &e)
	{
		ll amt=(ll)min(excess[e.from], (long long)e.cap - e.flow);
		if(height[e.from]<=height[e.to] || amt==0)
			return;
		e.flow += amt;
		g[e.to][e.index].flow -= amt;
		excess[e.to] += amt;
		excess[e.from] -= amt;
		enqueue(e.to);
	}

	void relabel(ll v)
	{
		count[height[v]]--;
		ll d=2*n;
		for(auto &it:g[v])
		{
			if(it.cap-it.flow>0)
				d=min(d, height[it.to]+1);
		}
		height[v]=d;
		count[height[v]]++;
		enqueue(v);
	}

	void gap(ll k)
	{
		for(ll v=0;v<n;v++)
		{
			if(height[v]<k)
				continue;
			count[height[v]]--;
			height[v]=max(height[v], n+1);
			count[height[v]]++;
			enqueue(v);
		}
	}

	void discharge(ll v)
	{
		for(ll i=0; excess[v]>0 && i<g[v].size(); i++)
			push(g[v][i]);
		if(excess[v]>0)
		{
			if(count[height[v]]==1)
				gap(height[v]);
			else
				relabel(v);
		}
	}

	long long max_flow(ll source, ll dest)
	{
		count[0] = n-1;
		count[n] = 1;
		height[source] = n;
		active[source] = active[dest] = 1;
		for(auto &it:g[source])
		{
			excess[source]+=it.cap;
			push(it);
		}

		while(!Q.empty())
		{
			ll v=Q.front();
			Q.pop();
			active[v]=false;
			discharge(v);
		}

		long long max_flow=0;
		for(auto &e:g[source])
			max_flow+=e.flow;

		return max_flow;
	}
};

vector<pair<ll,ll>> g[100];
// void reduc(ll x)
// {

// }
int main()
{
	ll n,m,x;
	cin>>n>>m>>x;
		// dicin d(n+1);
	for(ll i=1;i<=m;i++)
	{
		ll u, v, c;
		cin>>u>>v>>c;
		g[u].push_back({v, c});
		g[v].push_back({u, c});
		// d.addEdge(u, v, c);
		// d.addEdge(v, u, c);
	}
	double lb=0, ub=10000000, mid=(lb+ub)/2;
	double ans=0;
	int cnt=100;
	while(/*abs(lb-ub)>0.000000001*/cnt)
	{
		cnt--;
		dicin d(n+1);
		for (int i = 1; i < n+1; ++i)
		{
			for(auto j:g[i])
			{
				d.addEdge(i, j.first, floor((j.second)/mid));
			}
		}
		if(d.max_flow(1, n)>=x)
		{
			lb=mid;
		}
		else
		{
			ub=mid;
		}
		// cout << mid<<" "<<ans<<" "<<d.max_flow(1, n)<<"\n";

		mid=(lb+ub)/2;
		// if (abs(ans-mid)<0.000000001)
		// {
		// 	ans=mid;
		// 	break;
		// }
		ans=mid;
	}
	cout <<fixed<<setprecision(10)<< ans*x;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

struct edge
{
	ll from, to, cap, flow, index;
	edge(ll from, ll to, ll cap, ll flow, ll index):
		from(from), to(to), cap(cap), flow(flow), index(index) {}
};

struct dicin
{
	ll n;
	vector<vector<edge> > g;
	vector<long long> excess;
	vector<ll> height, active, count;
	queue<ll> Q;

	dicin(ll n):
		n(n), g(n), excess(n), height(n), active(n), count(2*n) {}

	void addEdge(ll from, ll to, ll cap)
	{
		g[from].push_back(edge(from, to, cap, 0, g[to].size()));
		if(from==to)
			g[from].back().index++;
		g[to].push_back(edge(to, from, 0, 0, g[from].size()-1));
	}

	void enqueue(ll v)
	{
		if(!active[v] && excess[v] > 0)
		{
			active[v]=true;
			Q.push(v);
		}
	}

	void push(edge &e)
	{
		ll amt=(ll)min(excess[e.from], (long long)e.cap - e.flow);
		if(height[e.from]<=height[e.to] || amt==0)
			return;
		e.flow += amt;
		g[e.to][e.index].flow -= amt;
		excess[e.to] += amt;
		excess[e.from] -= amt;
		enqueue(e.to);
	}

	void relabel(ll v)
	{
		count[height[v]]--;
		ll d=2*n;
		for(auto &it:g[v])
		{
			if(it.cap-it.flow>0)
				d=min(d, height[it.to]+1);
		}
		height[v]=d;
		count[height[v]]++;
		enqueue(v);
	}

	void gap(ll k)
	{
		for(ll v=0;v<n;v++)
		{
			if(height[v]<k)
				continue;
			count[height[v]]--;
			height[v]=max(height[v], n+1);
			count[height[v]]++;
			enqueue(v);
		}
	}

	void discharge(ll v)
	{
		for(ll i=0; excess[v]>0 && i<g[v].size(); i++)
			push(g[v][i]);
		if(excess[v]>0)
		{
			if(count[height[v]]==1)
				gap(height[v]);
			else
				relabel(v);
		}
	}

	long long max_flow(ll source, ll dest)
	{
		count[0] = n-1;
		count[n] = 1;
		height[source] = n;
		active[source] = active[dest] = 1;
		for(auto &it:g[source])
		{
			excess[source]+=it.cap;
			push(it);
		}

		while(!Q.empty())
		{
			ll v=Q.front();
			Q.pop();
			active[v]=false;
			discharge(v);
		}

		long long max_flow=0;
		for(auto &e:g[source])
			max_flow+=e.flow;

		return max_flow;
	}
};

vector<pair<ll,ll>> g[100];
// void reduc(ll x)
// {

// }
int main()
{
	ll n,m,x;
	cin>>n>>m>>x;
		// dicin d(n+1);
	for(ll i=1;i<=m;i++)
	{
		ll u, v, c;
		cin>>u>>v>>c;
		g[u].push_back({v, c});
		// g[v].push_back({u, c});
		// d.addEdge(u, v, c);
		// d.addEdge(v, u, c);
	}
	double lb=0, ub=1000000, mid=(lb+ub)/2;
	double ans=0;
	while(abs(lb-ub)>0.000000001)
	{
		dicin d(n+1);
		for (int i = 1; i < n+1; ++i)
		{
			for(auto j:g[i])
			{
				if (j.second/mid>x)
				{
					d.addEdge(i, j.first, x);
				}
				else
				{
					d.addEdge(i, j.first, (j.second)/mid);
				}
			}
		}
		if(d.max_flow(1, n)>=x)
		{
			lb=mid;
		}
		else
		{
			ub=mid;
		}
		// cout << mid<<" "<<ans<<" "<<d.max_flow(1, n)<<"\n";

		mid=(lb+ub)/2;
		if (abs(ans-mid)<0.000000001)
		{
			ans=mid;
			break;
		}
		ans=mid;
	}
	cout <<fixed<<setprecision(7)<< ans*x;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

class Dinics {
public:
	typedef int flowType; // can use float/double
	static const flowType INF = 1e9; // maximum capacity
	static const flowType EPS = 0; // minimum capacity/flow change

private:
	int nodes, src, dest;
	vector<int> dist, q, work;
	struct Edge {
	  int to, rev;
	  flowType f, cap;
	};
	vector< vector<Edge> > g;

	bool dinic_bfs() {
	  fill(dist.begin(), dist.end(), -1);
	  dist[src] = 0;
	  int qt = 0;
	  q[qt++] = src;
	  for (int qh = 0; qh < qt; qh++) {
	    int u = q[qh];
	    for (int j = 0; j < (int) g[u].size(); j++) {
	      Edge &e = g[u][j];
	      int v = e.to;
	      if (dist[v] < 0 && e.f < e.cap) {
	        dist[v] = dist[u] + 1;
	        q[qt++] = v;
	      }
	    }
	  }
	  return dist[dest] >= 0;
	}
	int dinic_dfs(int u, int f) {
	  if (u == dest)
	    return f;
	  for (int &i = work[u]; i < (int) g[u].size(); i++) {
	    Edge &e = g[u][i];
	    if (e.cap <= e.f) continue;
	    int v = e.to;
	    if (dist[v] == dist[u] + 1) {
	      flowType df = dinic_dfs(v, min(f, e.cap - e.f));
	      if (df > 0) {
	        e.f += df;
	        g[v][e.rev].f -= df;
	        return df;
	      }
	    }
	  }
	  return 0;
	}

public:
	Dinics(int n): dist(n, 0), q(n, 0),
		work(n, 0), g(n), nodes(n) {}

	// s->t (cap); t->s (rcap)
	void addEdge(int s, int t, flowType cap, flowType rcap = 0) {
	  g[s].push_back({t, (int) g[t].size(), 0, cap});
	  g[t].push_back({s, (int) g[s].size() - 1, 0, rcap});
	}
	flowType maxFlow(int _src, int _dest) {
	  src = _src;
	  dest = _dest;
	  flowType result = 0;
	  while (dinic_bfs()) {
	    fill(work.begin(), work.end(), 0);
			flowType delta;
	    while ((delta = dinic_dfs(src, INF)) > EPS)
	      result += delta;
	  }
	  return result;
	}
};

vector<pair<ll,ll>> g[100];
int main()
{
	ll n,m,x;
	cin>>n>>m>>x;
	for(ll i=1;i<=m;i++)
	{
		ll u, v, c;
		cin>>u>>v>>c;
		g[u].push_back({v, c});
		// g[v].push_back({u, c});
	}
	double lb=0, ub=10000000, mid/*(lb+ub)/2*/;
	double ans=0;
	int cnt=100;
	while(cnt)
	{
		cnt--;
		mid=(lb+ub)/2;
		Dinics d(n);
		for (int i = 1; i < n+1; ++i)
		{
			for(auto j:g[i])
			{
				if (j.second/mid>1e7)
				{
					d.addEdge(i-1, j.first-1, x);
				}
				else
				{
					d.addEdge(i-1, j.first-1, floor((j.second)/mid));
				}
			}
		}
		if(d.maxFlow(0, n-1)>=x)
		{
			lb=mid;
		}
		else
		{
			ub=mid;
		}
		ans=mid;
	}
	cout <<fixed<<setprecision(10)<< ans*x;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

class Dinics {
public:
	typedef int flowType; // can use float/double
	static const flowType INF = 1e9; // maximum capacity
	static const flowType EPS = 0; // minimum capacity/flow change

private:
	int nodes, src, dest;
	vector<int> dist, q, work;
	struct Edge {
	  int to, rev;
	  flowType f, cap;
	};
	vector< vector<Edge> > g;

	bool dinic_bfs() {
	  fill(dist.begin(), dist.end(), -1);
	  dist[src] = 0;
	  int qt = 0;
	  q[qt++] = src;
	  for (int qh = 0; qh < qt; qh++) {
	    int u = q[qh];
	    for (int j = 0; j < (int) g[u].size(); j++) {
	      Edge &e = g[u][j];
	      int v = e.to;
	      if (dist[v] < 0 && e.f < e.cap) {
	        dist[v] = dist[u] + 1;
	        q[qt++] = v;
	      }
	    }
	  }
	  return dist[dest] >= 0;
	}
	int dinic_dfs(int u, int f) {
	  if (u == dest)
	    return f;
	  for (int &i = work[u]; i < (int) g[u].size(); i++) {
	    Edge &e = g[u][i];
	    if (e.cap <= e.f) continue;
	    int v = e.to;
	    if (dist[v] == dist[u] + 1) {
	      flowType df = dinic_dfs(v, min(f, e.cap - e.f));
	      if (df > 0) {
	        e.f += df;
	        g[v][e.rev].f -= df;
	        return df;
	      }
	    }
	  }
	  return 0;
	}

public:
	Dinics(int n): dist(n, 0), q(n, 0),
		work(n, 0), g(n), nodes(n) {}

	// s->t (cap); t->s (rcap)
	void addEdge(int s, int t, flowType cap, flowType rcap = 0) {
	  g[s].push_back({t, (int) g[t].size(), 0, cap});
	  g[t].push_back({s, (int) g[s].size() - 1, 0, rcap});
	}
	flowType maxFlow(int _src, int _dest) {
	  src = _src;
	  dest = _dest;
	  flowType result = 0;
	  while (dinic_bfs()) {
	    fill(work.begin(), work.end(), 0);
			flowType delta;
	    while ((delta = dinic_dfs(src, INF)) > EPS)
	      result += delta;
	  }
	  return result;
	}
};

vector<pair<ll,ll>> g[100];
int main()
{
	ll n,m,x;
	cin>>n>>m>>x;
	for(ll i=1;i<=m;i++)
	{
		ll u, v, c;
		cin>>u>>v>>c;
		g[u].push_back({v, c});
		// g[v].push_back({u, c});
	}
	double lb=0, ub=10000000, mid/*(lb+ub)/2*/;
	double ans=0;
	int cnt=70;
	while(cnt)
	{
		cnt--;
		mid=(lb+ub)/2;
		Dinics d(n);
		for (int i = 1; i < n+1; ++i)
		{
			for(auto j:g[i])
			{
				d.addEdge(i-1, j.first-1, floor((j.second)/mid));
			}
		}
		if(d.maxFlow(0, n-1)>=x)
		{
			lb=mid;
		}
		else
		{
			ub=mid;
		}
		ans=mid;
	}
	cout <<fixed<<setprecision(10)<< ans*x;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

struct edge
{
	ll from, to, cap, flow, index;
	edge(ll from, ll to, ll cap, ll flow, ll index):
		from(from), to(to), cap(cap), flow(flow), index(index) {}
};

struct dicin
{
	ll n;
	vector<vector<edge> > g;
	vector<long long> excess;
	vector<ll> height, active, count;
	queue<ll> Q;

	dicin(ll n):
		n(n), g(n), excess(n), height(n), active(n), count(2*n) {}

	void addEdge(ll from, ll to, ll cap)
	{
		g[from].push_back(edge(from, to, cap, 0, g[to].size()));
		if(from==to)
			g[from].back().index++;
		g[to].push_back(edge(to, from, 0, 0, g[from].size()-1));
	}

	void enqueue(ll v)
	{
		if(!active[v] && excess[v] > 0)
		{
			active[v]=true;
			Q.push(v);
		}
	}

	void push(edge &e)
	{
		ll amt=(ll)min(excess[e.from], (long long)e.cap - e.flow);
		if(height[e.from]<=height[e.to] || amt==0)
			return;
		e.flow += amt;
		g[e.to][e.index].flow -= amt;
		excess[e.to] += amt;
		excess[e.from] -= amt;
		enqueue(e.to);
	}

	void relabel(ll v)
	{
		count[height[v]]--;
		ll d=2*n;
		for(auto &it:g[v])
		{
			if(it.cap-it.flow>0)
				d=min(d, height[it.to]+1);
		}
		height[v]=d;
		count[height[v]]++;
		enqueue(v);
	}

	void gap(ll k)
	{
		for(ll v=0;v<n;v++)
		{
			if(height[v]<k)
				continue;
			count[height[v]]--;
			height[v]=max(height[v], n+1);
			count[height[v]]++;
			enqueue(v);
		}
	}

	void discharge(ll v)
	{
		for(ll i=0; excess[v]>0 && i<g[v].size(); i++)
			push(g[v][i]);
		if(excess[v]>0)
		{
			if(count[height[v]]==1)
				gap(height[v]);
			else
				relabel(v);
		}
	}

	long long max_flow(ll source, ll dest)
	{
		count[0] = n-1;
		count[n] = 1;
		height[source] = n;
		active[source] = active[dest] = 1;
		for(auto &it:g[source])
		{
			excess[source]+=it.cap;
			push(it);
		}

		while(!Q.empty())
		{
			ll v=Q.front();
			Q.pop();
			active[v]=false;
			discharge(v);
		}

		long long max_flow=0;
		for(auto &e:g[source])
			max_flow+=e.flow;

		return max_flow;
	}
};

vector<pair<ll,ll>> g[100];
// void reduc(ll x)
// {

// }
int main()
{
	ll n,m,x;
	cin>>n>>m>>x;
		// dicin d(n+1);
	for(ll i=1;i<=m;i++)
	{
		ll u, v, c;
		cin>>u>>v>>c;
		g[u].push_back({v, c});
		g[v].push_back({u, c});
		// d.addEdge(u, v, c);
		// d.addEdge(v, u, c);
	}
	double lb=0, ub=1000000, mid=(lb+ub)/2;
	double ans=0;
	while(abs(lb-ub)>0.000000001)
	{
		dicin d(n+1);
		for (int i = 1; i < n+1; ++i)
		{
			for(auto j:g[i])
			{
				d.addEdge(i, j.first, (j.second)/mid);
			}
		}
		if(d.max_flow(1, n)>=x)
		{
			lb=mid;
		}
		else
		{
			ub=mid;
		}
		cout << mid<<" "<<ans<<" "<<d.max_flow(1, n)<<"\n";

		mid=(lb+ub)/2;
		if (abs(ans-mid)<0.000000001)
		{
			ans=mid;
			break;
		}
		ans=mid;
	}
	cout <<fixed<<setprecision(7)<< ans*x;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

class Dinics {
public:
	typedef int flowType; // can use float/double
	static const flowType INF = 1e9; // maximum capacity
	static const flowType EPS = 0; // minimum capacity/flow change

private:
	int nodes, src, dest;
	vector<int> dist, q, work;
	struct Edge {
	  int to, rev;
	  flowType f, cap;
	};
	vector< vector<Edge> > g;

	bool dinic_bfs() {
	  fill(dist.begin(), dist.end(), -1);
	  dist[src] = 0;
	  int qt = 0;
	  q[qt++] = src;
	  for (int qh = 0; qh < qt; qh++) {
	    int u = q[qh];
	    for (int j = 0; j < (int) g[u].size(); j++) {
	      Edge &e = g[u][j];
	      int v = e.to;
	      if (dist[v] < 0 && e.f < e.cap) {
	        dist[v] = dist[u] + 1;
	        q[qt++] = v;
	      }
	    }
	  }
	  return dist[dest] >= 0;
	}
	int dinic_dfs(int u, int f) {
	  if (u == dest)
	    return f;
	  for (int &i = work[u]; i < (int) g[u].size(); i++) {
	    Edge &e = g[u][i];
	    if (e.cap <= e.f) continue;
	    int v = e.to;
	    if (dist[v] == dist[u] + 1) {
	      flowType df = dinic_dfs(v, min(f, e.cap - e.f));
	      if (df > 0) {
	        e.f += df;
	        g[v][e.rev].f -= df;
	        return df;
	      }
	    }
	  }
	  return 0;
	}

public:
	Dinics(int n): dist(n, 0), q(n, 0),
		work(n, 0), g(n), nodes(n) {}

	// s->t (cap); t->s (rcap)
	void addEdge(int s, int t, flowType cap, flowType rcap = 0) {
	  g[s].push_back({t, (int) g[t].size(), 0, cap});
	  g[t].push_back({s, (int) g[s].size() - 1, 0, rcap});
	}
	flowType maxFlow(int _src, int _dest) {
	  src = _src;
	  dest = _dest;
	  flowType result = 0;
	  while (dinic_bfs()) {
	    fill(work.begin(), work.end(), 0);
			flowType delta;
	    while ((delta = dinic_dfs(src, INF)) > EPS)
	      result += delta;
	  }
	  return result;
	}
};

vector<pair<ll,ll>> g[100];
int main()
{
	ll n,m,x;
	cin>>n>>m>>x;
	for(ll i=1;i<=m;i++)
	{
		ll u, v, c;
		cin>>u>>v>>c;
		g[u].push_back({v, c});
		// g[v].push_back({u, c});
	}
	double lb=0, ub=10000000, mid/*(lb+ub)/2*/;
	double ans=0;
	int cnt=100;
	while(cnt)
	{
		cnt--;
		mid=(lb+ub)/2;
		Dinics d(n);
		for (int i = 1; i < n+1; ++i)
		{
			for(auto j:g[i])
			{
				d.addEdge(i-1, j.first-1, floor((j.second)/mid));
			}
		}
		if(d.maxFlow(0, n-1)>=x)
		{
			lb=mid;
		}
		else
		{
			ub=mid;
		}
		ans=mid;
	}
	cout <<fixed<<setprecision(10)<< ans*x;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

class Dinics {
public:
	typedef int flowType; // can use float/double
	static const flowType INF = 1e9; // maximum capacity
	static const flowType EPS = 0; // minimum capacity/flow change

private:
	int nodes, src, dest;
	vector<int> dist, q, work;
	struct Edge {
	  int to, rev;
	  flowType f, cap;
	};
	vector< vector<Edge> > g;

	bool dinic_bfs() {
	  fill(dist.begin(), dist.end(), -1);
	  dist[src] = 0;
	  int qt = 0;
	  q[qt++] = src;
	  for (int qh = 0; qh < qt; qh++) {
	    int u = q[qh];
	    for (int j = 0; j < (int) g[u].size(); j++) {
	      Edge &e = g[u][j];
	      int v = e.to;
	      if (dist[v] < 0 && e.f < e.cap) {
	        dist[v] = dist[u] + 1;
	        q[qt++] = v;
	      }
	    }
	  }
	  return dist[dest] >= 0;
	}
	int dinic_dfs(int u, int f) {
	  if (u == dest)
	    return f;
	  for (int &i = work[u]; i < (int) g[u].size(); i++) {
	    Edge &e = g[u][i];
	    if (e.cap <= e.f) continue;
	    int v = e.to;
	    if (dist[v] == dist[u] + 1) {
	      flowType df = dinic_dfs(v, min(f, e.cap - e.f));
	      if (df > 0) {
	        e.f += df;
	        g[v][e.rev].f -= df;
	        return df;
	      }
	    }
	  }
	  return 0;
	}

public:
	Dinics(int n): dist(n, 0), q(n, 0),
		work(n, 0), g(n), nodes(n) {}

	// s->t (cap); t->s (rcap)
	void addEdge(int s, int t, flowType cap, flowType rcap = 0) {
	  g[s].push_back({t, (int) g[t].size(), 0, cap});
	  g[t].push_back({s, (int) g[s].size() - 1, 0, rcap});
	}
	flowType maxFlow(int _src, int _dest) {
	  src = _src;
	  dest = _dest;
	  flowType result = 0;
	  while (dinic_bfs()) {
	    fill(work.begin(), work.end(), 0);
			flowType delta;
	    while ((delta = dinic_dfs(src, INF)) > EPS)
	      result += delta;
	  }
	  return result;
	}
};

vector<pair<ll,ll>> g[100];
int main()
{
	ll n,m,x;
	cin>>n>>m>>x;
	for(ll i=1;i<=m;i++)
	{
		ll u, v, c;
		cin>>u>>v>>c;
		g[u].push_back({v, c});
		g[v].push_back({u, c});
	}
	double lb=0, ub=10000000, mid=(lb+ub)/2;
	double ans=0;
	int cnt=70;
	while(cnt)
	{
		cnt--;
		Dinics d(n);
		for (int i = 1; i < n+1; ++i)
		{
			for(auto j:g[i])
			{
				d.addEdge(i-1, j.first-1, floor((j.second)/mid));
			}
		}
		if(d.maxFlow(0, n-1)>=x)
		{
			lb=mid;
		}
		else
		{
			ub=mid;
		}
		mid=(lb+ub)/2;
		ans=mid;
	}
	cout <<fixed<<setprecision(10)<< ans*x;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

struct edge
{
	ll from, to, cap, flow, index;
	edge(ll from, ll to, ll cap, ll flow, ll index):
		from(from), to(to), cap(cap), flow(flow), index(index) {}
};

struct dicin
{
	ll n;
	vector<vector<edge> > g;
	vector<long long> excess;
	vector<ll> height, active, count;
	queue<ll> Q;

	dicin(ll n):
		n(n), g(n), excess(n), height(n), active(n), count(2*n) {}

	void addEdge(ll from, ll to, ll cap)
	{
		g[from].push_back(edge(from, to, cap, 0, g[to].size()));
		if(from==to)
			g[from].back().index++;
		g[to].push_back(edge(to, from, 0, 0, g[from].size()-1));
	}

	void enqueue(ll v)
	{
		if(!active[v] && excess[v] > 0)
		{
			active[v]=true;
			Q.push(v);
		}
	}

	void push(edge &e)
	{
		ll amt=(ll)min(excess[e.from], (long long)e.cap - e.flow);
		if(height[e.from]<=height[e.to] || amt==0)
			return;
		e.flow += amt;
		g[e.to][e.index].flow -= amt;
		excess[e.to] += amt;
		excess[e.from] -= amt;
		enqueue(e.to);
	}

	void relabel(ll v)
	{
		count[height[v]]--;
		ll d=2*n;
		for(auto &it:g[v])
		{
			if(it.cap-it.flow>0)
				d=min(d, height[it.to]+1);
		}
		height[v]=d;
		count[height[v]]++;
		enqueue(v);
	}

	void gap(ll k)
	{
		for(ll v=0;v<n;v++)
		{
			if(height[v]<k)
				continue;
			count[height[v]]--;
			height[v]=max(height[v], n+1);
			count[height[v]]++;
			enqueue(v);
		}
	}

	void discharge(ll v)
	{
		for(ll i=0; excess[v]>0 && i<g[v].size(); i++)
			push(g[v][i]);
		if(excess[v]>0)
		{
			if(count[height[v]]==1)
				gap(height[v]);
			else
				relabel(v);
		}
	}

	long long max_flow(ll source, ll dest)
	{
		count[0] = n-1;
		count[n] = 1;
		height[source] = n;
		active[source] = active[dest] = 1;
		for(auto &it:g[source])
		{
			excess[source]+=it.cap;
			push(it);
		}

		while(!Q.empty())
		{
			ll v=Q.front();
			Q.pop();
			active[v]=false;
			discharge(v);
		}

		long long max_flow=0;
		for(auto &e:g[source])
			max_flow+=e.flow;

		return max_flow;
	}
};

vector<pair<ll,ll>> g[100];
// void reduc(ll x)
// {

// }
int main()
{
	ll n,m,x;
	cin>>n>>m>>x;
		// dicin d(n+1);
	for(ll i=1;i<=m;i++)
	{
		ll u, v, c;
		cin>>u>>v>>c;
		g[u].push_back({v, c});
		// g[v].push_back({u, c});
		// d.addEdge(u, v, c);
		// d.addEdge(v, u, c);
	}
	double lb=0, ub=1000000, mid=(lb+ub)/2;
	double ans=0;
	while(abs(lb-ub)>0.000000001)
	{
		dicin d(n+1);
		for (int i = 1; i < n+1; ++i)
		{
			for(auto j:g[i])
			{
				d.addEdge(i, j.first, (j.second)/mid);
			}
		}
		if(d.max_flow(1, n)>=x)
		{
			lb=mid;
		}
		else
		{
			ub=mid;
		}
		// cout << mid<<" "<<ans<<" "<<d.max_flow(1, n)<<"\n";

		mid=(lb+ub)/2;
		if (abs(ans-mid)<0.000000001)
		{
			ans=mid;
			break;
		}
		ans=mid;
	}
	cout <<fixed<<setprecision(7)<< ans*x;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

struct edge
{
	ll from, to, cap, flow, index;
	edge(ll from, ll to, ll cap, ll flow, ll index):
		from(from), to(to), cap(cap), flow(flow), index(index) {}
};

struct dicin
{
	ll n;
	vector<vector<edge> > g;
	vector<long long> excess;
	vector<ll> height, active, count;
	queue<ll> Q;

	dicin(ll n):
		n(n), g(n), excess(n), height(n), active(n), count(2*n) {}

	void addEdge(ll from, ll to, ll cap)
	{
		g[from].push_back(edge(from, to, cap, 0, g[to].size()));
		if(from==to)
			g[from].back().index++;
		g[to].push_back(edge(to, from, 0, 0, g[from].size()-1));
	}

	void enqueue(ll v)
	{
		if(!active[v] && excess[v] > 0)
		{
			active[v]=true;
			Q.push(v);
		}
	}

	void push(edge &e)
	{
		ll amt=(ll)min(excess[e.from], (long long)e.cap - e.flow);
		if(height[e.from]<=height[e.to] || amt==0)
			return;
		e.flow += amt;
		g[e.to][e.index].flow -= amt;
		excess[e.to] += amt;
		excess[e.from] -= amt;
		enqueue(e.to);
	}

	void relabel(ll v)
	{
		count[height[v]]--;
		ll d=2*n;
		for(auto &it:g[v])
		{
			if(it.cap-it.flow>0)
				d=min(d, height[it.to]+1);
		}
		height[v]=d;
		count[height[v]]++;
		enqueue(v);
	}

	void gap(ll k)
	{
		for(ll v=0;v<n;v++)
		{
			if(height[v]<k)
				continue;
			count[height[v]]--;
			height[v]=max(height[v], n+1);
			count[height[v]]++;
			enqueue(v);
		}
	}

	void discharge(ll v)
	{
		for(ll i=0; excess[v]>0 && i<g[v].size(); i++)
			push(g[v][i]);
		if(excess[v]>0)
		{
			if(count[height[v]]==1)
				gap(height[v]);
			else
				relabel(v);
		}
	}

	long long max_flow(ll source, ll dest)
	{
		count[0] = n-1;
		count[n] = 1;
		height[source] = n;
		active[source] = active[dest] = 1;
		for(auto &it:g[source])
		{
			excess[source]+=it.cap;
			push(it);
		}

		while(!Q.empty())
		{
			ll v=Q.front();
			Q.pop();
			active[v]=false;
			discharge(v);
		}

		long long max_flow=0;
		for(auto &e:g[source])
			max_flow+=e.flow;

		return max_flow;
	}
};

vector<pair<ll,ll>> g[100];
// void reduc(ll x)
// {

// }
int main()
{
	ll n,m,x;
	cin>>n>>m>>x;
		// dicin d(n+1);
	for(ll i=1;i<=m;i++)
	{
		ll u, v, c;
		cin>>u>>v>>c;
		g[u].push_back({v, c});
		g[v].push_back({u, c});
		// d.addEdge(u, v, c);
		// d.addEdge(v, u, c);
	}
	double lb=0, ub=10000000, mid=(lb+ub)/2;
	double ans=0;
	int cnt=100;
	while(/*abs(lb-ub)>0.000000001*/cnt)
	{
		cnt--;
		dicin d(n+1);
		for (int i = 1; i < n+1; ++i)
		{
			for(auto j:g[i])
			{
				if (j.second/mid>x)
				{
					d.addEdge(i, j.first, x);
				}
				else
				{
					d.addEdge(i, j.first, floor((j.second)/mid));
				}
			}
		}
		if(d.max_flow(1, n)>=x)
		{
			lb=mid;
		}
		else
		{
			ub=mid;
		}
		// cout << mid<<" "<<ans<<" "<<d.max_flow(1, n)<<"\n";

		mid=(lb+ub)/2;
		// if (abs(ans-mid)<0.000000001)
		// {
		// 	ans=mid;
		// 	break;
		// }
		ans=mid;
	}
	cout <<fixed<<setprecision(10)<< ans*x;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

struct edge
{
	ll from, to, cap, flow, index;
	edge(ll from, ll to, ll cap, ll flow, ll index):
		from(from), to(to), cap(cap), flow(flow), index(index) {}
};

struct dicin
{
	ll n;
	vector<vector<edge> > g;
	vector<long long> excess;
	vector<ll> height, active, count;
	queue<ll> Q;

	dicin(ll n):
		n(n), g(n), excess(n), height(n), active(n), count(2*n) {}

	void addEdge(ll from, ll to, ll cap)
	{
		g[from].push_back(edge(from, to, cap, 0, g[to].size()));
		if(from==to)
			g[from].back().index++;
		g[to].push_back(edge(to, from, 0, 0, g[from].size()-1));
	}

	void enqueue(ll v)
	{
		if(!active[v] && excess[v] > 0)
		{
			active[v]=true;
			Q.push(v);
		}
	}

	void push(edge &e)
	{
		ll amt=(ll)min(excess[e.from], (long long)e.cap - e.flow);
		if(height[e.from]<=height[e.to] || amt==0)
			return;
		e.flow += amt;
		g[e.to][e.index].flow -= amt;
		excess[e.to] += amt;
		excess[e.from] -= amt;
		enqueue(e.to);
	}

	void relabel(ll v)
	{
		count[height[v]]--;
		ll d=2*n;
		for(auto &it:g[v])
		{
			if(it.cap-it.flow>0)
				d=min(d, height[it.to]+1);
		}
		height[v]=d;
		count[height[v]]++;
		enqueue(v);
	}

	void gap(ll k)
	{
		for(ll v=0;v<n;v++)
		{
			if(height[v]<k)
				continue;
			count[height[v]]--;
			height[v]=max(height[v], n+1);
			count[height[v]]++;
			enqueue(v);
		}
	}

	void discharge(ll v)
	{
		for(ll i=0; excess[v]>0 && i<g[v].size(); i++)
			push(g[v][i]);
		if(excess[v]>0)
		{
			if(count[height[v]]==1)
				gap(height[v]);
			else
				relabel(v);
		}
	}

	long long max_flow(ll source, ll dest)
	{
		count[0] = n-1;
		count[n] = 1;
		height[source] = n;
		active[source] = active[dest] = 1;
		for(auto &it:g[source])
		{
			excess[source]+=it.cap;
			push(it);
		}

		while(!Q.empty())
		{
			ll v=Q.front();
			Q.pop();
			active[v]=false;
			discharge(v);
		}

		long long max_flow=0;
		for(auto &e:g[source])
			max_flow+=e.flow;

		return max_flow;
	}
};

vector<pair<ll,ll>> g[100];
// void reduc(ll x)
// {

// }
int main()
{
	ll n,m,x;
	cin>>n>>m>>x;
		// dicin d(n+1);
	for(ll i=1;i<=m;i++)
	{
		ll u, v, c;
		cin>>u>>v>>c;
		g[u].push_back({v, c});
		g[v].push_back({u, c});
		// d.addEdge(u, v, c);
		// d.addEdge(v, u, c);
	}
	double lb=0, ub=1e7, mid=(lb+ub)/2;
	double ans=0;
	int cnt=100;
	while(/*abs(lb-ub)>0.000000001*/cnt)
	{
		cnt--;
		dicin d(n+1);
		for (int i = 1; i < n+1; ++i)
		{
			for(auto j:g[i])
			{
				d.addEdge(i, j.first, (j.second)/mid);
			}
		}
		if(d.max_flow(1, n)>=x)
		{
			lb=mid;
		}
		else
		{
			ub=mid;
		}
		// cout << mid<<" "<<ans<<" "<<d.max_flow(1, n)<<"\n";

		mid=(lb+ub)/2;
		// if (abs(ans-mid)<0.000000001)
		// {
		// 	ans=mid;
		// 	break;
		// }
		ans=mid;
	}
	cout <<fixed<<setprecision(10)<< ans*x;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

struct edge
{
	ll from, to, cap, flow, index;
	edge(ll from, ll to, ll cap, ll flow, ll index):
		from(from), to(to), cap(cap), flow(flow), index(index) {}
};

struct dicin
{
	ll n;
	vector<vector<edge> > g;
	vector<long long> excess;
	vector<ll> height, active, count;
	queue<ll> Q;

	dicin(ll n):
		n(n), g(n), excess(n), height(n), active(n), count(2*n) {}

	void addEdge(ll from, ll to, ll cap)
	{
		g[from].push_back(edge(from, to, cap, 0, g[to].size()));
		if(from==to)
			g[from].back().index++;
		g[to].push_back(edge(to, from, 0, 0, g[from].size()-1));
	}

	void enqueue(ll v)
	{
		if(!active[v] && excess[v] > 0)
		{
			active[v]=true;
			Q.push(v);
		}
	}

	void push(edge &e)
	{
		ll amt=(ll)min(excess[e.from], (long long)e.cap - e.flow);
		if(height[e.from]<=height[e.to] || amt==0)
			return;
		e.flow += amt;
		g[e.to][e.index].flow -= amt;
		excess[e.to] += amt;
		excess[e.from] -= amt;
		enqueue(e.to);
	}

	void relabel(ll v)
	{
		count[height[v]]--;
		ll d=2*n;
		for(auto &it:g[v])
		{
			if(it.cap-it.flow>0)
				d=min(d, height[it.to]+1);
		}
		height[v]=d;
		count[height[v]]++;
		enqueue(v);
	}

	void gap(ll k)
	{
		for(ll v=0;v<n;v++)
		{
			if(height[v]<k)
				continue;
			count[height[v]]--;
			height[v]=max(height[v], n+1);
			count[height[v]]++;
			enqueue(v);
		}
	}

	void discharge(ll v)
	{
		for(ll i=0; excess[v]>0 && i<g[v].size(); i++)
			push(g[v][i]);
		if(excess[v]>0)
		{
			if(count[height[v]]==1)
				gap(height[v]);
			else
				relabel(v);
		}
	}

	long long max_flow(ll source, ll dest)
	{
		count[0] = n-1;
		count[n] = 1;
		height[source] = n;
		active[source] = active[dest] = 1;
		for(auto &it:g[source])
		{
			excess[source]+=it.cap;
			push(it);
		}

		while(!Q.empty())
		{
			ll v=Q.front();
			Q.pop();
			active[v]=false;
			discharge(v);
		}

		long long max_flow=0;
		for(auto &e:g[source])
			max_flow+=e.flow;

		return max_flow;
	}
};

vector<pair<ll,ll>> g[100];
// void reduc(ll x)
// {

// }
int main()
{
	ll n,m,x;
	cin>>n>>m>>x;
		// dicin d(n+1);
	for(ll i=1;i<=m;i++)
	{
		ll u, v, c;
		cin>>u>>v>>c;
		g[u].push_back({v, c});
		g[v].push_back({u, c});
		// d.addEdge(u, v, c);
		// d.addEdge(v, u, c);
	}
	double lb=0, ub=1000000, mid=(lb+ub)/2;
	double ans=0;
	while(abs(lb-ub)>0.000000001)
	{
		dicin d(n+1);
		for (int i = 1; i < n+1; ++i)
		{
			for(auto j:g[i])
			{
				d.addEdge(i, j.first, (j.second)/mid);
			}
		}
		if(d.max_flow(1, n)>=x)
		{
			lb=mid;
		}
		else
		{
			ub=mid;
		}
		// cout << mid<<" "<<ans<<" "<<d.max_flow(1, n)<<"\n";

		mid=(lb+ub)/2;
		if (abs(ans-mid)<0.000000001)
		{
			ans=mid;
			break;
		}
		ans=mid;
	}
	cout <<fixed<<setprecision(7)<< ans*x;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

struct edge
{
	ll from, to, cap, flow, index;
	edge(ll from, ll to, ll cap, ll flow, ll index):
		from(from), to(to), cap(cap), flow(flow), index(index) {}
};

struct dicin
{
	ll n;
	vector<vector<edge> > g;
	vector<long long> excess;
	vector<ll> height, active, count;
	queue<ll> Q;

	dicin(ll n):
		n(n), g(n), excess(n), height(n), active(n), count(2*n) {}

	void addEdge(ll from, ll to, ll cap)
	{
		g[from].push_back(edge(from, to, cap, 0, g[to].size()));
		if(from==to)
			g[from].back().index++;
		g[to].push_back(edge(to, from, 0, 0, g[from].size()-1));
	}

	void enqueue(ll v)
	{
		if(!active[v] && excess[v] > 0)
		{
			active[v]=true;
			Q.push(v);
		}
	}

	void push(edge &e)
	{
		ll amt=(ll)min(excess[e.from], (long long)e.cap - e.flow);
		if(height[e.from]<=height[e.to] || amt==0)
			return;
		e.flow += amt;
		g[e.to][e.index].flow -= amt;
		excess[e.to] += amt;
		excess[e.from] -= amt;
		enqueue(e.to);
	}

	void relabel(ll v)
	{
		count[height[v]]--;
		ll d=2*n;
		for(auto &it:g[v])
		{
			if(it.cap-it.flow>0)
				d=min(d, height[it.to]+1);
		}
		height[v]=d;
		count[height[v]]++;
		enqueue(v);
	}

	void gap(ll k)
	{
		for(ll v=0;v<n;v++)
		{
			if(height[v]<k)
				continue;
			count[height[v]]--;
			height[v]=max(height[v], n+1);
			count[height[v]]++;
			enqueue(v);
		}
	}

	void discharge(ll v)
	{
		for(ll i=0; excess[v]>0 && i<g[v].size(); i++)
			push(g[v][i]);
		if(excess[v]>0)
		{
			if(count[height[v]]==1)
				gap(height[v]);
			else
				relabel(v);
		}
	}

	long long max_flow(ll source, ll dest)
	{
		count[0] = n-1;
		count[n] = 1;
		height[source] = n;
		active[source] = active[dest] = 1;
		for(auto &it:g[source])
		{
			excess[source]+=it.cap;
			push(it);
		}

		while(!Q.empty())
		{
			ll v=Q.front();
			Q.pop();
			active[v]=false;
			discharge(v);
		}

		long long max_flow=0;
		for(auto &e:g[source])
			max_flow+=e.flow;

		return max_flow;
	}
};

vector<pair<ll,ll>> g[100];
// void reduc(ll x)
// {

// }
int main()
{
	ll n,m,x;
	cin>>n>>m>>x;
		// dicin d(n+1);
	for(ll i=1;i<=m;i++)
	{
		ll u, v, c;
		cin>>u>>v>>c;
		g[u].push_back({v, c});
		g[v].push_back({u, c});
		// d.addEdge(u, v, c);
		// d.addEdge(v, u, c);
	}
	double lb=0, ub=10000000, mid=(lb+ub)/2;
	double ans=0;
	int cnt=70;
	while(/*abs(lb-ub)>0.000000001*/cnt)
	{
		cnt--;
		dicin d(n+1);
		for (int i = 1; i < n+1; ++i)
		{
			for(auto j:g[i])
			{
				if (j.second/mid>x)
				{
					d.addEdge(i, j.first, x);
				}
				else
				{
					d.addEdge(i, j.first, floor((j.second)/mid));
				}
			}
		}
		if(d.max_flow(1, n)>=x)
		{
			lb=mid;
		}
		else
		{
			ub=mid;
		}
		// cout << mid<<" "<<ans<<" "<<d.max_flow(1, n)<<"\n";

		mid=(lb+ub)/2;
		// if (abs(ans-mid)<0.000000001)
		// {
		// 	ans=mid;
		// 	break;
		// }
		ans=mid;
	}
	cout <<fixed<<setprecision(10)<< ans*x;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;

class Dinics {
public:
	typedef int flowType; // can use float/double
	static const flowType INF = 1e9; // maximum capacity
	static const flowType EPS = 0; // minimum capacity/flow change

private:
	int nodes, src, dest;
	vector<int> dist, q, work;
	struct Edge {
	  int to, rev;
	  flowType f, cap;
	};
	vector< vector<Edge> > g;

	bool dinic_bfs() {
	  fill(dist.begin(), dist.end(), -1);
	  dist[src] = 0;
	  int qt = 0;
	  q[qt++] = src;
	  for (int qh = 0; qh < qt; qh++) {
	    int u = q[qh];
	    for (int j = 0; j < (int) g[u].size(); j++) {
	      Edge &e = g[u][j];
	      int v = e.to;
	      if (dist[v] < 0 && e.f < e.cap) {
	        dist[v] = dist[u] + 1;
	        q[qt++] = v;
	      }
	    }
	  }
	  return dist[dest] >= 0;
	}
	int dinic_dfs(int u, int f) {
	  if (u == dest)
	    return f;
	  for (int &i = work[u]; i < (int) g[u].size(); i++) {
	    Edge &e = g[u][i];
	    if (e.cap <= e.f) continue;
	    int v = e.to;
	    if (dist[v] == dist[u] + 1) {
	      flowType df = dinic_dfs(v, min(f, e.cap - e.f));
	      if (df > 0) {
	        e.f += df;
	        g[v][e.rev].f -= df;
	        return df;
	      }
	    }
	  }
	  return 0;
	}

public:
	Dinics(int n): dist(n, 0), q(n, 0),
		work(n, 0), g(n), nodes(n) {}

	// s->t (cap); t->s (rcap)
	void addEdge(int s, int t, flowType cap, flowType rcap = 0) {
	  g[s].push_back({t, (int) g[t].size(), 0, cap});
	  g[t].push_back({s, (int) g[s].size() - 1, 0, rcap});
	}
	flowType maxFlow(int _src, int _dest) {
	  src = _src;
	  dest = _dest;
	  flowType result = 0;
	  while (dinic_bfs()) {
	    fill(work.begin(), work.end(), 0);
			flowType delta;
	    while ((delta = dinic_dfs(src, INF)) > EPS)
	      result += delta;
	  }
	  return result;
	}
};

vector<pair<ll,ll>> g[100];
int main()
{
	ll n,m,x;
	cin>>n>>m>>x;
	for(ll i=1;i<=m;i++)
	{
		ll u, v, c;
		cin>>u>>v>>c;
		g[u].push_back({v, c});
		g[v].push_back({u, c});
	}
	double lb=0, ub=10000000, mid/*(lb+ub)/2*/;
	double ans=0;
	int cnt=70;
	while(cnt)
	{
		cnt--;
		mid=(lb+ub)/2;
		Dinics d(n);
		for (int i = 1; i < n+1; ++i)
		{
			for(auto j:g[i])
			{
				d.addEdge(i-1, j.first-1, floor((j.second)/mid));
			}
		}
		if(d.maxFlow(0, n-1)>=x)
		{
			lb=mid;
		}
		else
		{
			ub=mid;
		}
		ans=mid;
	}
	cout <<fixed<<setprecision(10)<< ans*x;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){ cout << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);}
#else
#define trace(...)
#endif
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout<<setprecision(25);
#define endl '\n'
#define F first
#define S second
#define I insert
#define pb push_back
#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define vll vector<ll>
#define vpll vector<pll>
struct edge{
	ll x,y,cap,flow;
	edge() {}
	edge(ll x,ll y,ll cap, ll flow) : x(x), y(y), cap(cap), flow(flow) {}
};

struct Dinic{
	const ll inf = 1e18;
	vector<edge> E;
	vector<ll> dep,ind;
	vector<vector<ll>> adj;
	ll n,src,sink;
	Dinic() {}
	Dinic(ll n){
		this->n = n;
		dep = vector<ll>(n+1);
		ind = vector<ll>(n+1);
		adj = vector<vector<ll>>(n+1);
	}
	void addEdge(ll x,ll y,ll c){
		edge edge1(x,y,c,0);
		edge edge2(y,x,0,0);
		adj[x].pb(E.size()); E.pb(edge1);
		adj[y].pb(E.size()); E.pb(edge2);
	}
	bool bfs(){
		fill(dep.begin(),dep.end(),-1);
		queue<ll> qu;
		dep[src]=0; qu.push(src);
		while(!qu.empty()){
			ll curr = qu.front(); qu.pop();
			for(auto z : adj[curr]){
				if(dep[E[z].y] != -1 || E[z].cap-E[z].flow == 0) continue;
				dep[E[z].y] = dep[curr]+1; qu.push(E[z].y);
			}
		}
		if(dep[sink] == -1) return false;
		return true;
	}
	ll dfs(ll v, ll flow){
		if(flow == 0) return 0;
		for(;ind[v]<adj[v].size();ind[v]++){
			ll i = adj[v][ind[v]];
			if(dep[E[i].y] != dep[v]+1) continue;
			ll pushed = dfs(E[i].y,min(flow,E[i].cap-E[i].flow));
			if(pushed){
				E[i].flow += pushed;
				E[i^1].flow -= pushed;
				return pushed;
			}
		}
		if(v==sink) return flow;
		return 0;
	}
	ll maxFlow(ll src,ll sink){
		this->src = src; this->sink = sink;
		ll ans = 0;
		while(bfs()){
			for(ll i=0;i<=n;i++) ind[i]=0;
			while(ll flow = dfs(src,inf)) ans += flow;
		}
		return ans;
	}
};

// int main()
// {
//     IOS
//     ll n,m;
//     cin >> n>> m;
//     Dinic net(n);
//     for(ll i=1;i<=m;i++){
//     	ll a,b,c;
//     	cin>>a>>b>>c;
//     	net.addEdge(a,b,c);
//     }
//     ll src,sink;
//     cin>>src>>sink;
//     cout << net.maxFlow(src,sink) << endl;
// }
vector<pair<pll,ll> > ed;
int32_t main()
{
    IOS
    ll a,b,c,n,m,x,i,j,k;
    cin>>n>>m>>x;
    for(i=0;i<m;i++){
    	cin>>a>>b>>c;
    	ed.pb({{a,b},c});
    }
    ld lo,hi,mi;
    lo = 0;
    hi = 1e6 + 2;
    ld ans = 0.0;
    for(i=0;i<=100;i++){
    	mi = (hi+lo)/2.0;
    	Dinic net(n);
	    for(auto z : ed){
	    	ld flo = mi;
	    	ld cap = (ld)z.S/flo;
	    	cap += (1e-8);
	    	c = cap;
	    	net.addEdge(z.F.F,z.F.S,c);
	    }
	    c = net.maxFlow(1,n);
	    if(c >= x){
	    	ans = mi;
	    	lo=mi;
	    }
	    else{
	    	hi=mi;
	    }
    }
    ans = ans*x;
    cout << ans << endl;
}


#include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){ cout << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);}
#else
#define trace(...)
#endif
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout<<setprecision(25);
#define endl '\n'
#define F first
#define S second
#define I insert
#define pb push_back
#define ll long long
#define ld long double
#define pll pair<ll,ll>
#define vll vector<ll>
#define vpll vector<pll>
struct edge{
	ll x,y,cap,flow;
	edge() {}
	edge(ll x,ll y,ll cap, ll flow) : x(x), y(y), cap(cap), flow(flow) {}
};

struct Dinic{
	const ll inf = 1e18;
	vector<edge> E;
	vector<ll> dep,ind;
	vector<vector<ll>> adj;
	ll n,src,sink;
	Dinic() {}
	Dinic(ll n){
		this->n = n;
		dep = vector<ll>(n+1);
		ind = vector<ll>(n+1);
		adj = vector<vector<ll>>(n+1);
	}
	void addEdge(ll x,ll y,ll c){
		edge edge1(x,y,c,0);
		edge edge2(y,x,0,0);
		adj[x].pb(E.size()); E.pb(edge1);
		adj[y].pb(E.size()); E.pb(edge2);
	}
	bool bfs(){
		fill(dep.begin(),dep.end(),-1);
		queue<ll> qu;
		dep[src]=0; qu.push(src);
		while(!qu.empty()){
			ll curr = qu.front(); qu.pop();
			for(auto z : adj[curr]){
				if(dep[E[z].y] != -1 || E[z].cap-E[z].flow == 0) continue;
				dep[E[z].y] = dep[curr]+1; qu.push(E[z].y);
			}
		}
		if(dep[sink] == -1) return false;
		return true;
	}
	ll dfs(ll v, ll flow){
		for(;ind[v]<adj[v].size();ind[v]++){
			ll i = adj[v][ind[v]];
			if(dep[E[i].y] != dep[v]+1) continue;
			ll pushed = dfs(E[i].y,min(flow,E[i].cap-E[i].flow));
			if(pushed){
				E[i].flow += pushed;
				E[i^1].flow -= pushed;
				return pushed;
			}
		}
		if(v==sink) return flow;
		return 0;
	}
	ll maxFlow(ll src,ll sink){
		this->src = src; this->sink = sink;
		ll ans = 0;
		while(bfs()){
			for(ll i=0;i<=n;i++) ind[i]=0;
			while(ll flow = dfs(src,inf)) ans += flow;
		}
		return ans;
	}
};

// int main()
// {
//     IOS
//     ll n,m;
//     cin >> n>> m;
//     Dinic net(n);
//     for(ll i=1;i<=m;i++){
//     	ll a,b,c;
//     	cin>>a>>b>>c;
//     	net.addEdge(a,b,c);
//     }
//     ll src,sink;
//     cin>>src>>sink;
//     cout << net.maxFlow(src,sink) << endl;
// }
vector<pair<pll,ll> > ed;
int32_t main()
{
    IOS
    ll a,b,c,n,m,x,i,j,k;
    cin>>n>>m>>x;
    for(i=0;i<m;i++){
    	cin>>a>>b>>c;
    	ed.pb({{a,b},c});
    }
    ld lo,hi,mi;
    lo = 0;
    hi = 1e11 + 2;
    ld ans = 0.0;
    while(hi-lo > (1e-7)){
    	mi = (hi+lo)/2.0;
    	Dinic net(n);
	    for(auto z : ed){
	    	ld flo = mi/x;
	    	ld cap = (ld)z.S/flo;
	    	cap += (1e-8);
	    	c = cap;
	    	net.addEdge(z.F.F,z.F.S,c);
	    }
	    c = net.maxFlow(1,n);
	    if(c >= x){
	    	ans = mi;
	    	lo=mi;
	    }
	    else{
	    	hi=mi;
	    }
    }
    cout << ans << endl;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
ll INF = 1e9;
struct edge {
    int x, y, cap, flow;
};

struct Dinics {
    vector <edge> e;
    vector <int> cur, d;
    vector < vector <int> > adj;
    int n, source, sink;

    Dinics() {}

    Dinics(int v) {
        n = v;
        cur = vector <int> (n + 1);
        d = vector <int> (n + 1);
        adj = vector < vector <int> > (n + 1);
    }

    void addEdge(int from, int to, int cap) {
        edge e1 = {from, to, cap, 0};
        edge e2 = {to, from, 0, 0};
        adj[from].push_back(e.size()); e.push_back(e1);
        adj[to].push_back(e.size()); e.push_back(e2);
    }

    int bfs() {
        queue <int> q;
        for(int i = 0; i <= n; ++i) d[i] = -1;
        q.push(source); d[source] = 0;
        while(!q.empty() and d[sink] < 0) {
            int x = q.front(); q.pop();
            for(int i = 0; i < (int)adj[x].size(); ++i) {
                int id = adj[x][i], y = e[id].y;
                if(d[y] < 0 and e[id].flow < e[id].cap) {
                    q.push(y); d[y] = d[x] + 1;
                }
            }
        }
        return d[sink] >= 0;
    }

    int dfs(int x, int flow) {
        if(!flow) return 0;
        if(x == sink) return flow;
        for(;cur[x] < (int)adj[x].size(); ++cur[x]) {
            int id = adj[x][cur[x]], y = e[id].y;
            if(d[y] != d[x] + 1) continue;
            int pushed = dfs(y, min(flow, e[id].cap - e[id].flow));
            if(pushed) {
                e[id].flow += pushed;
                e[id ^ 1].flow -= pushed;
                return pushed;
            }
        }
        return 0;
    }

    int maxFlow(int src, int snk) {
        this->source = src; this->sink = snk;
        int flow = 0;
        while(bfs()) {
            for(int i = 0; i <= n; ++i) cur[i] = 0;
            while(int pushed = dfs(source, INF)) {
                flow += pushed;
            }
        }
        return flow;
    }
};

vector< pair<int, pii > > edges;
int n,m,x;
bool psbl(double k)
{
	Dinics d(n+2);
	for(int i=0;i<m;i++)
	{
		int cst = edges[i].first;
		pii tmp = edges[i].second;
		ll f = (ll)(cst/k);
// 		if(f>x)f=x;
		if(f>0)d.addEdge(tmp.first, tmp.second, f);
	}
	int fl = d.maxFlow(1,n);
	if(fl >=x )return true;
	return false;
}
int main()
{
	cin>>n>>m>>x;
	for(int i=1;i<=m;i++)
	{
		int u,v,c;
		cin>>u>>v>>c;
		edges.push_back(make_pair(c,pii(u,v)));
	}
	double l = 0, r = 1000000;
	for(int i=1;i<=100;i++)
	{
		double mid = (l+r)/2;
		if(psbl(mid))
		{
			l=mid;
		}
		else r = mid;
	}

	printf("%.10f\n",l*x);
}


#include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){ cout << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);}
#else
#define trace(...)
#endif
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout<<fixed<<setprecision(25);
#define endl '\n'
#define F first
#define S second
#define I insert
#define pb push_back
#define ll long long
#define int long long
#define ld long double
#define pll pair<ll,ll>
#define vll vector<ll>
#define vpll vector<pll>
#define sz(x) (ll)(x).size()
#define all(x) (x).begin(), (x).end()

ll power(ll a,ll b,ll mod){ll c=1;while(b>0){if(b%2)c*=a,c%=mod;b/=2;a*=a;a%=mod;}return c;}

const ll N = 1e5+5;
const ll M = 320;
ll Mod = 998244353; //1e9+7;

const int INF = 1e8;
const int inf = 0x3f3f3f3f;

struct edge {
    int x, y, cap, flow;
};

struct DinicFlow {
    vector <edge> e;
    vector <int> cur, d;
    vector < vector <int> > adj;
    int n, source, sink;

    DinicFlow() {}

    DinicFlow(int v) {
        n = v;
        cur = vector <int> (n + 1);
        d = vector <int> (n + 1);
        adj = vector < vector <int> > (n + 1);
    }

    void addEdge(int from, int to, int cap) {
        edge e1 = {from, to, cap, 0};
        edge e2 = {to, from, 0, 0};
        adj[from].push_back(e.size()); e.push_back(e1);
        adj[to].push_back(e.size()); e.push_back(e2);
    }

    int bfs() {
        queue <int> q;
        for(int i = 0; i <= n; ++i) d[i] = -1;
        q.push(source); d[source] = 0;
        while(!q.empty() and d[sink] < 0) {
            int x = q.front(); q.pop();
            for(int i = 0; i < (int)adj[x].size(); ++i) {
                int id = adj[x][i], y = e[id].y;
                if(d[y] < 0 and e[id].flow < e[id].cap) {
                    q.push(y); d[y] = d[x] + 1;
                }
            }
        }
        return d[sink] >= 0;
    }

    int dfs(int x, int flow) {
        if(!flow) return 0;
        if(x == sink) return flow;
        for(;cur[x] < (int)adj[x].size(); ++cur[x]) {
            int id = adj[x][cur[x]], y = e[id].y;
            if(d[y] != d[x] + 1) continue;
            int pushed = dfs(y, min(flow, e[id].cap - e[id].flow));
            if(pushed) {
                e[id].flow += pushed;
                e[id ^ 1].flow -= pushed;
                return pushed;
            }
        }
        return 0;
    }

    int maxFlow(int src, int snk) {
        this->source = src; this->sink = snk;
        int flow = 0;
        while(bfs()) {
            for(int i = 0; i <= n; ++i) cur[i] = 0;
            while(int pushed = dfs(source, inf)) {
                flow += pushed;
            }
        }
        return flow;
    }
};
vector<pair<pll,ll> > ed;
int32_t main()
{
    IOS
    ll a,b,c,n,m,x,i,j,k;
    cin>>n>>m>>x;
    for(i=0;i<m;i++){
    	cin>>a>>b>>c;
    	ed.pb({{a,b},c});
    }
    ld lo,hi,mi;
    lo = 0;
    hi = 1e6 + 2;
    ld ans = 0.0;
    for(i=0;i<=100;i++){
    	mi = (hi+lo)/2.0;
    	DinicFlow net(n);
	    for(auto z : ed){
	    	ld flo = mi;
	    	ld cap = (ld)z.S/flo;
	    	cap += (1e-8);
	    	c = cap;
	    	net.addEdge(z.F.F,z.F.S,c);
	    }
	    c = net.maxFlow(1,n);
	    if(c >= x){
	    	ans = mi;
	    	lo=mi;
	    }
	    else{
	    	hi=mi;
	    }
    }
    ans = ans*x;
    cout << ans << endl;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
int INF = 1e9;
struct edge {
    int x, y, cap, flow;
};

struct Dinics {
    vector <edge> e;
    vector <int> cur, d;
    vector < vector <int> > adj;
    int n, source, sink;

    Dinics() {}

    Dinics(int v) {
        n = v;
        cur = vector <int> (n + 1);
        d = vector <int> (n + 1);
        adj = vector < vector <int> > (n + 1);
    }

    void addEdge(int from, int to, int cap) {
        edge e1 = {from, to, cap, 0};
        edge e2 = {to, from, 0, 0};
        adj[from].push_back(e.size()); e.push_back(e1);
        adj[to].push_back(e.size()); e.push_back(e2);
    }

    int bfs() {
        queue <int> q;
        for(int i = 0; i <= n; ++i) d[i] = -1;
        q.push(source); d[source] = 0;
        while(!q.empty() and d[sink] < 0) {
            int x = q.front(); q.pop();
            for(int i = 0; i < (int)adj[x].size(); ++i) {
                int id = adj[x][i], y = e[id].y;
                if(d[y] < 0 and e[id].flow < e[id].cap) {
                    q.push(y); d[y] = d[x] + 1;
                }
            }
        }
        return d[sink] >= 0;
    }

    int dfs(int x, int flow) {
        if(!flow) return 0;
        if(x == sink) return flow;
        for(;cur[x] < (int)adj[x].size(); ++cur[x]) {
            int id = adj[x][cur[x]], y = e[id].y;
            if(d[y] != d[x] + 1) continue;
            int pushed = dfs(y, min(flow, e[id].cap - e[id].flow));
            if(pushed) {
                e[id].flow += pushed;
                e[id ^ 1].flow -= pushed;
                return pushed;
            }
        }
        return 0;
    }

    int maxFlow(int src, int snk) {
        this->source = src; this->sink = snk;
        int flow = 0;
        while(bfs()) {
            for(int i = 0; i <= n; ++i) cur[i] = 0;
            while(int pushed = dfs(source, INF)) {
                flow += pushed;
            }
        }
        return flow;
    }
};

vector< pair<int, pii > > edges;
int n,m,x;
bool psbl(double k)
{
	Dinics d(n+2);
	for(int i=0;i<m;i++)
	{
		int cst = edges[i].first;
		pii tmp = edges[i].second;
		int f = (int)(cst/k);
		if(f>0)d.addEdge(tmp.first, tmp.second, f);
	}
	int fl = d.maxFlow(1,n);
	if(fl >=x )return true;
	return false;
}
int main()
{
	cin>>n>>m>>x;
	for(int i=1;i<=m;i++)
	{
		int u,v,c;
		cin>>u>>v>>c;
		edges.push_back(make_pair(c,pii(u,v)));
	}
	double l = 0, r = 1000000;
	for(int i=1;i<=100;i++)
	{
		double mid = (l+r)/2;
		if(psbl(mid))
		{
			l=mid;
		}
		else r = mid;
	}

	printf("%.10f\n",l*x);
}


#include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){ cout << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);}
#else
#define trace(...)
#endif
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout<<fixed<<setprecision(25);
#define endl '\n'
#define F first
#define S second
#define I insert
#define pb push_back
#define ll long long
#define int long long
#define ld long double
#define pll pair<ll,ll>
#define vll vector<ll>
#define vpll vector<pll>
#define sz(x) (ll)(x).size()
#define all(x) (x).begin(), (x).end()

ll power(ll a,ll b,ll mod){ll c=1;while(b>0){if(b%2)c*=a,c%=mod;b/=2;a*=a;a%=mod;}return c;}

const ll N = 1e5+5;
const ll M = 320;
ll Mod = 998244353; //1e9+7;

const int INF = 1e8;
const int inf = 0x3f3f3f3f;

struct edge {
    int x, y, cap, flow;
};

struct DinicFlow {
    vector <edge> e;
    vector <int> cur, d;
    vector < vector <int> > adj;
    int n, source, sink;

    DinicFlow() {}

    DinicFlow(int v) {
        n = v;
        cur = vector <int> (n + 1);
        d = vector <int> (n + 1);
        adj = vector < vector <int> > (n + 1);
    }

    void addEdge(int from, int to, int cap) {
        edge e1 = {from, to, cap, 0};
        edge e2 = {to, from, 0, 0};
        adj[from].push_back(e.size()); e.push_back(e1);
        adj[to].push_back(e.size()); e.push_back(e2);
    }

    int bfs() {
        queue <int> q;
        for(int i = 0; i <= n; ++i) d[i] = -1;
        q.push(source); d[source] = 0;
        while(!q.empty() and d[sink] < 0) {
            int x = q.front(); q.pop();
            for(int i = 0; i < (int)adj[x].size(); ++i) {
                int id = adj[x][i], y = e[id].y;
                if(d[y] < 0 and e[id].flow < e[id].cap) {
                    q.push(y); d[y] = d[x] + 1;
                }
            }
        }
        return d[sink] >= 0;
    }

    int dfs(int x, int flow) {
        if(!flow) return 0;
        if(x == sink) return flow;
        for(;cur[x] < (int)adj[x].size(); ++cur[x]) {
            int id = adj[x][cur[x]], y = e[id].y;
            if(d[y] != d[x] + 1) continue;
            int pushed = dfs(y, min(flow, e[id].cap - e[id].flow));
            if(pushed) {
                e[id].flow += pushed;
                e[id ^ 1].flow -= pushed;
                return pushed;
            }
        }
        return 0;
    }

    int maxFlow(int src, int snk) {
        this->source = src; this->sink = snk;
        int flow = 0;
        while(bfs()) {
            for(int i = 0; i <= n; ++i) cur[i] = 0;
            while(int pushed = dfs(source, inf)) {
                flow += pushed;
            }
        }
        return flow;
    }
};
vector<pair<pll,ll> > ed;
int32_t main()
{
    IOS
    ll a,b,c,n,m,x,i,j,k;
    cin>>n>>m>>x;
    for(i=0;i<m;i++){
    	cin>>a>>b>>c;
    	ed.pb({{a,b},c});
    }
    ld lo,hi,mi;
    lo = 0;
    hi = 1e6 + 2;
    ld ans = 0.0;
    while(hi-lo > (1e-7)){
    	mi = (hi+lo)/2.0;
    	DinicFlow net(n);
	    for(auto z : ed){
	    	ld flo = mi;
	    	ld cap = (ld)z.S/flo;
	    	cap += (1e-8);
	    	c = cap;
	    	net.addEdge(z.F.F,z.F.S,c);
	    }
	    c = net.maxFlow(1,n);
	    if(c >= x){
	    	ans = mi;
	    	lo=mi;
	    }
	    else{
	    	hi=mi;
	    }
    }
    ans = ans*x;
    cout << ans << endl;
}


#include<bits/stdc++.h>
using namespace std;
#define FasterIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
typedef long long     ll;
typedef pair<int,int> pi;
#define ff first
#define ss second

const int MX=100000;
const int inf=1e9;

struct DinicMaxflow
{
    struct edge
    {
        int a, b, cap, flow ;
        edge(int _a, int _b, int _c, int _d)
        {
            a = _a, b = _b, cap = _c, flow = _d;
        }
    } ;

    int n, s, t, level [ MX ], ptr [ MX ] ;
    vector < edge > e ;
    vector < int > g [ MX ] ;
    queue<int>q;

    void add_edge ( int a, int b, int cap )
    {
        edge e1 = edge( a, b, cap, 0 ) ;
        edge e2 = edge( b, a, 0, 0 ) ;
        g [ a ] . push_back ( ( int ) e. size ( ) ) ;
        e. push_back ( e1 ) ;
        g [ b ] . push_back ( ( int ) e. size ( ) ) ;
        e. push_back ( e2 ) ;
    }
    bool bfs ( )
    {
        memset ( level, -1, sizeof level ) ;
        level [ s ] = 0 ;
        q.push(s);
        while( !q.empty() )
        {
            int u = q.front();
            q.pop();
            for(int i=0; i<g[u].size(); i++)
            {
                int id = g[u][i];
                int v = e[id].b;
                if ( level [ v ] == - 1 && e [ id ] . flow < e [ id ] . cap )
                {
                    level[v] = level[u]+1;
                    q.push(v);
                }
            }
        }
        return level [ t ] != - 1 ;
    }
    int dfs ( int u, int flow )
    {
        if ( ! flow )  return 0 ;
        if ( u == t )  return flow ;
        for ( ; ptr [ u ] < ( int ) g [ u ] . size ( ) ; ++ ptr [ u ] )
        {
            int id = g [ u ] [ ptr [ u ] ] ;
            int v = e [ id ] . b ;
            if ( level [ v ] != level [ u ] + 1 )  continue ;
            int mxflow = dfs ( v, min ( flow, e [ id ] . cap - e [ id ] . flow ) ) ;
            if ( mxflow )
            {
                e [ id ] . flow += mxflow ;
                e [ id ^ 1 ] . flow -= mxflow ;
                return mxflow ;
            }
        }
        return 0 ;
    }
    int MaxFlow ( )
    {
        int flow = 0 ;
        while(bfs())
        {
            memset ( ptr, 0, sizeof ptr ) ;
            while ( int mxflow = dfs ( s, inf ) )
            {
                flow += mxflow ;
                if(mxflow == 0)break;
            }
        }
        return flow ;
    }

    void init( int _n, int _s, int _t )
    {
        n = _n;
        s = _s;
        t = _t;
        for(int i=0; i<e.size(); i++) e[i].flow=0;
    }
    void RESET()
    {
        e.clear();
        for(int i=0; i<=n; i++) g[i].clear();
    }
} DMF;

vector<pair<int, pi> >ed;

int main()
{
    FasterIO;
    int n, m, x;
    cin>>n>>m>>x;
    for(int i=1; i<=m; i++)
    {
        int a, b, cap;
        cin>>a>>b>>cap;
        ed.push_back({cap, {a, b}});
    }
    double lo=0, hi=1000000000, md, res=0;
    for(int i=0; i<=200; i++)
    {
        md=(lo+hi)/2.0;
        DMF.RESET();
        DMF.init(n,1,n);
        for(int i=0; i<m; i++)
        {
            DMF.add_edge(ed[i].ss.ff, ed[i].ss.ss, (1.0*ed[i].ff)/md);
        }
        int ans=DMF.MaxFlow();
        if(ans>=x)
        {
            res=md; lo=md;
        }
        else hi=md;
    }
    cout<<(x*1.0*res)<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define FasterIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
typedef long long   ll;
typedef pair<ll,ll> pi;
#define ff first
#define ss second

const ll MX=100000;
const ll inf=1e9;

struct DinicMaxflow
{
    struct edge
    {
        ll a, b, cap, flow ;
        edge(ll _a, ll _b, ll _c, ll _d)
        {
            a = _a, b = _b, cap = _c, flow = _d;
        }
    } ;

    ll n, s, t, level [ MX ], ptr [ MX ] ;
    vector < edge > e ;
    vector < ll > g [ MX ] ;
    queue<ll>q;

    void add_edge ( ll a, ll b, ll cap )
    {
        edge e1 = edge( a, b, cap, 0 ) ;
        edge e2 = edge( b, a, 0, 0 ) ;
        g [ a ] . push_back ( ( ll ) e. size ( ) ) ;
        e. push_back ( e1 ) ;
        g [ b ] . push_back ( ( ll ) e. size ( ) ) ;
        e. push_back ( e2 ) ;
    }
    bool bfs ( )
    {
        memset ( level, -1, sizeof level ) ;
        level [ s ] = 0 ;
        q.push(s);
        while( !q.empty() )
        {
            ll u = q.front();
            q.pop();
            for(ll i=0; i<g[u].size(); i++)
            {
                ll id = g[u][i];
                ll v = e[id].b;
                if ( level [ v ] == - 1 && e [ id ] . flow < e [ id ] . cap )
                {
                    level[v] = level[u]+1;
                    q.push(v);
                }
            }
        }
        return level [ t ] != - 1 ;
    }
    ll dfs ( ll u, ll flow )
    {
        if ( ! flow )  return 0 ;
        if ( u == t )  return flow ;
        for ( ; ptr [ u ] < ( ll ) g [ u ] . size ( ) ; ++ ptr [ u ] )
        {
            ll id = g [ u ] [ ptr [ u ] ] ;
            ll v = e [ id ] . b ;
            if ( level [ v ] != level [ u ] + 1 )  continue ;
            ll mxflow = dfs ( v, min ( flow, e [ id ] . cap - e [ id ] . flow ) ) ;
            if ( mxflow )
            {
                e [ id ] . flow += mxflow ;
                e [ id ^ 1 ] . flow -= mxflow ;
                return mxflow ;
            }
        }
        return 0 ;
    }
    ll MaxFlow ( )
    {
        ll flow = 0 ;
        while(bfs())
        {
            memset ( ptr, 0, sizeof ptr ) ;
            while ( ll mxflow = dfs ( s, inf ) )
            {
                flow += mxflow ;
                if(mxflow == 0)break;
            }
        }
        return flow ;
    }

    void init( ll _n, ll _s, ll _t )
    {
        n = _n;
        s = _s;
        t = _t;
        for(ll i=0; i<e.size(); i++) e[i].flow=0;
    }
    void RESET()
    {
        e.clear();
        for(ll i=0; i<=n; i++) g[i].clear();
    }
} DMF;

vector<pair<ll, pi> >ed;

int main()
{
    FasterIO;
    ll n, m, x;
    cin>>n>>m>>x;
    for(ll i=1; i<=m; i++)
    {
        ll a, b, cap;
        cin>>a>>b>>cap;
        ed.push_back({cap, {a, b}});
    }
    double lo=0, hi=1000000000, md, res=0;
    for(ll i=0; i<=200; i++)
    {
        md=(lo+hi)/2.0;
        DMF.RESET();
        DMF.init(n,1,n);
        for(ll i=0; i<m; i++)
        {
            DMF.add_edge(ed[i].ss.ff, ed[i].ss.ss, (1.0*ed[i].ff)/md);
        }
        ll ans=DMF.MaxFlow();
        if(ans>=x)
        {
            res=md; lo=md;
        }
        else hi=md;
    }
    cout<<setprecision(10)<<fixed<<(x*1.0*res)<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define FasterIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
typedef long long     ll;
typedef pair<int,int> pi;
#define ff first
#define ss second

const int MX=100000;
const int inf=1e9;

struct DinicMaxflow
{
    struct edge
    {
        int a, b, cap, flow ;
        edge(int _a, int _b, int _c, int _d)
        {
            a = _a, b = _b, cap = _c, flow = _d;
        }
    } ;

    int n, s, t, level [ MX ], ptr [ MX ] ;
    vector < edge > e ;
    vector < int > g [ MX ] ;
    queue<int>q;

    void add_edge ( int a, int b, int cap )
    {
        edge e1 = edge( a, b, cap, 0 ) ;
        edge e2 = edge( b, a, 0, 0 ) ;
        g [ a ] . push_back ( ( int ) e. size ( ) ) ;
        e. push_back ( e1 ) ;
        g [ b ] . push_back ( ( int ) e. size ( ) ) ;
        e. push_back ( e2 ) ;
    }
    bool bfs ( )
    {
        memset ( level, -1, sizeof level ) ;
        level [ s ] = 0 ;
        q.push(s);
        while( !q.empty() )
        {
            int u = q.front();
            q.pop();
            for(int i=0; i<g[u].size(); i++)
            {
                int id = g[u][i];
                int v = e[id].b;
                if ( level [ v ] == - 1 && e [ id ] . flow < e [ id ] . cap )
                {
                    level[v] = level[u]+1;
                    q.push(v);
                }
            }
        }
        return level [ t ] != - 1 ;
    }
    int dfs ( int u, int flow )
    {
        if ( ! flow )  return 0 ;
        if ( u == t )  return flow ;
        for ( ; ptr [ u ] < ( int ) g [ u ] . size ( ) ; ++ ptr [ u ] )
        {
            int id = g [ u ] [ ptr [ u ] ] ;
            int v = e [ id ] . b ;
            if ( level [ v ] != level [ u ] + 1 )  continue ;
            int mxflow = dfs ( v, min ( flow, e [ id ] . cap - e [ id ] . flow ) ) ;
            if ( mxflow )
            {
                e [ id ] . flow += mxflow ;
                e [ id ^ 1 ] . flow -= mxflow ;
                return mxflow ;
            }
        }
        return 0 ;
    }
    int MaxFlow ( )
    {
        int flow = 0 ;
        while(bfs())
        {
            memset ( ptr, 0, sizeof ptr ) ;
            while ( int mxflow = dfs ( s, inf ) )
            {
                flow += mxflow ;
                if(mxflow == 0)break;
            }
        }
        return flow ;
    }

    void init( int _n, int _s, int _t )
    {
        n = _n;
        s = _s;
        t = _t;
        for(int i=0; i<e.size(); i++) e[i].flow=0;
    }
    void RESET()
    {
        e.clear();
        for(int i=0; i<=n; i++) g[i].clear();
    }
} DMF;

vector<pair<int, pi> >ed;

int main()
{
    FasterIO;
    int n, m, x;
    cin>>n>>m>>x;
    for(int i=1; i<=m; i++)
    {
        int a, b, cap;
        cin>>a>>b>>cap;
        ed.push_back({cap, {a, b}});
    }
    double lo=0, hi=1000000000, md, res=0;
    for(int i=0; i<=200; i++)
    {
        md=(lo+hi)/2.0;
        DMF.RESET();
        DMF.init(n,1,n);
        for(int i=0; i<m; i++)
        {
            DMF.add_edge(ed[i].ss.ff, ed[i].ss.ss, (1.0*ed[i].ff)/md);
        }
        int ans=DMF.MaxFlow();
        if(ans>=x)
        {
            res=md; lo=md;
        }
        else hi=md;
    }
    cout<<setprecision(10)<<fixed<<(x*1.0*res)<<endl;
    return 0;
}