#include <fstream>
#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
#include <random>
#include <math.h>
#include <complex>
#include <set>
#include <string>
#include <bitset>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef double db;
typedef string str;

typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef pair<db,db> pd;

typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<db> vd;
typedef vector<str> vs;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<pd> vpd;

#define mp make_pair
#define f first
#define s second
#define sz(x) (int)(x).size()
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define pf push_front
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)

const int MOD = 1e9+7; // 998244353;
const int MX = 2e5+5;
const ll INF = 1e18;
const ld PI = acos((ld)-1);
const int xd[4] = {1,0,-1,0}, yd[4] = {0,1,0,-1};
//mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());

template<class T> bool ckmin(T& a, const T& b) {
    return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) {
    return a < b ? a = b, 1 : 0; }
constexpr int pct(int x) { return __builtin_popcount(x); }
constexpr int bits(int x) { return 31-__builtin_clz(x); } // floor(log2(x))
ll cdiv(ll a, ll b) { return a/b+((a^b)>0&&a%b); } // divide a by b rounded up
ll fdiv(ll a, ll b) { return a/b-((a^b)<0&&a%b); } // divide a by b rounded down
ll half(ll x) { return fdiv(x,2); }

template<class T, class U> T fstTrue(T lo, T hi, U f) {
    hi ++; assert(lo <= hi); // assuming f is increasing
    while (lo < hi) { // find first index such that f is true
        T mid = half(lo+hi);
        f(mid) ? hi = mid : lo = mid+1;
    }
    return lo;
}
template<class T, class U> T lstTrue(T lo, T hi, U f) {
    lo --; assert(lo <= hi); // assuming f is decreasing
    while (lo < hi) { // find first index such that f is true
        T mid = half(lo+hi+1);
        f(mid) ? lo = mid : hi = mid-1;
    }
    return lo;
}
template<class T> void remDup(vector<T>& v) {
    sort(all(v)); v.erase(unique(all(v)),end(v)); }

// INPUT
template<class A> void re(complex<A>& c);
template<class A, class B> void re(pair<A,B>& p);
template<class A> void re(vector<A>& v);
template<class A, size_t SZ> void re(array<A,SZ>& a);

template<class T> void re(T& x) { cin >> x; }
void re(db& d) { str t; re(t); d = stod(t); }
void re(ld& d) { str t; re(t); d = stold(t); }
template<class H, class... T> void re(H& h, T&... t) { re(h); re(t...); }

template<class A> void re(complex<A>& c) { A a,b; re(a,b); c = {a,b}; }
template<class A, class B> void re(pair<A,B>& p) { re(p.f,p.s); }
template<class A> void re(vector<A>& x) { trav(a,x) re(a); }
template<class A, size_t SZ> void re(array<A,SZ>& x) { trav(a,x) re(a); }

// TO_STRING
#define ts to_string
str ts(char c) { return str(1,c); }
str ts(const char* s) { return (str)s; }
str ts(str s) { return s; }
str ts(bool b) {
#ifdef LOCAL
    return b ? "true" : "false";
#else
    return ts((int)b);
#endif
}
template<class A> str ts(complex<A> c) {
    stringstream ss; ss << c; return ss.str(); }
str ts(vector<bool> v) {
    str res = "{"; F0R(i,sz(v)) res += char('0'+v[i]);
    res += "}"; return res; }
template<size_t SZ> str ts(bitset<SZ> b) {
    str res = ""; F0R(i,SZ) res += char('0'+b[i]);
    return res; }
template<class A, class B> str ts(pair<A,B> p);
template<class T> str ts(T v) { // containers with begin(), end()
#ifdef LOCAL
    bool fst = 1; str res = "{";
		for (const auto& x: v) {
			if (!fst) res += ", ";
			fst = 0; res += ts(x);
		}
		res += "}"; return res;
#else
    bool fst = 1; str res = "";
    for (const auto& x: v) {
        if (!fst) res += " ";
        fst = 0; res += ts(x);
    }
    return res;

#endif
}
template<class A, class B> str ts(pair<A,B> p) {
#ifdef LOCAL
    return "("+ts(p.f)+", "+ts(p.s)+")";
#else
    return ts(p.f)+" "+ts(p.s);
#endif
}

// OUTPUT
template<class A> void pr(A x) { cout << ts(x); }
template<class H, class... T> void pr(const H& h, const T&... t) {
    pr(h); pr(t...); }
void ps() { pr("\n"); } // print w/ spaces
template<class H, class... T> void ps(const H& h, const T&... t) {
    pr(h); if (sizeof...(t)) pr(" "); ps(t...); }

// DEBUG
void DBG() { cerr << "]" << endl; }
template<class H, class... T> void DBG(H h, T... t) {
    cerr << ts(h); if (sizeof...(t)) cerr << ", ";
    DBG(t...); }

// #define LOCAL

#ifdef LOCAL // compile with -DLOCAL
#define dbg(...) cerr << "LINE(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#else
#define dbg(...) 0
#endif

// FILE I/O
void setIn(str s) { freopen(s.c_str(),"r",stdin); }
void setOut(str s) { freopen(s.c_str(),"w",stdout); }
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); }
void setIO(str s = "") {
    unsyncIO();
    // cin.exceptions(cin.failbit);
    // throws exception when do smth illegal
    // ex. try to read letter into int
    if (sz(s)) { setIn(s+".in"), setOut(s+".out"); } // for USACO
}

inline bool viable(int l, int r, vector<int> arr, int maxTime) {
    if (arr[r] - arr[l] <= maxTime) {
        return true;
    }
    return false;
}

int binarySearch(int l, int r, vector<int> arr, int maxTime) {
    int old = -1;
    while (l <= r) {
        if (old == r) {
            return -1;
        }
        if (viable(l, r, arr, maxTime)) {
            return r;
        }
        else {
            int mid = (l + r)/2;
            old = r;
            r = mid;
        }
    }
    return -1;
}

int longestSequence(vector<int> prefixSum, int maxBooks, int maxTime) {
    int maxCount = 0;
    dbg(maxCount);
    for (int i = 0; i < maxBooks; i++) {
        int j = binarySearch(i, maxBooks, prefixSum, maxTime);
        dbg(i, j, maxCount);
        if (j != -1) {
            maxCount = max(j - i, maxCount);
            //dbg(j, maxCount);
        }
    }
    return maxCount;
}

int main() {
    int n, t;
    re(n, t);

    vector<int> minutes(n);
    vector<int> prefixSum(n + 1);

    F0R(i, n) {
        re(minutes[i]);
        prefixSum[i + 1] = prefixSum[i] + minutes[i];
    }

    int x = longestSequence(prefixSum, n, t);
    pr(x);
}

/* stuff you should look for
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* WRITE STUFF DOWN
*/


#include <fstream>
#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
#include <random>
#include <math.h>
#include <complex>
#include <set>
#include <string>
#include <bitset>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef double db;
typedef string str;

typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef pair<db,db> pd;

typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<db> vd;
typedef vector<str> vs;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<pd> vpd;

#define mp make_pair
#define f first
#define s second
#define sz(x) (int)(x).size()
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define pf push_front
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)

const int MOD = 1e9+7; // 998244353;
const int MX = 2e5+5;
const ll INF = 1e18;
const ld PI = acos((ld)-1);
const int xd[4] = {1,0,-1,0}, yd[4] = {0,1,0,-1};
//mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());

template<class T> bool ckmin(T& a, const T& b) {
    return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) {
    return a < b ? a = b, 1 : 0; }
constexpr int pct(int x) { return __builtin_popcount(x); }
constexpr int bits(int x) { return 31-__builtin_clz(x); } // floor(log2(x))
ll cdiv(ll a, ll b) { return a/b+((a^b)>0&&a%b); } // divide a by b rounded up
ll fdiv(ll a, ll b) { return a/b-((a^b)<0&&a%b); } // divide a by b rounded down
ll half(ll x) { return fdiv(x,2); }

template<class T, class U> T fstTrue(T lo, T hi, U f) {
    hi ++; assert(lo <= hi); // assuming f is increasing
    while (lo < hi) { // find first index such that f is true
        T mid = half(lo+hi);
        f(mid) ? hi = mid : lo = mid+1;
    }
    return lo;
}
template<class T, class U> T lstTrue(T lo, T hi, U f) {
    lo --; assert(lo <= hi); // assuming f is decreasing
    while (lo < hi) { // find first index such that f is true
        T mid = half(lo+hi+1);
        f(mid) ? lo = mid : hi = mid-1;
    }
    return lo;
}
template<class T> void remDup(vector<T>& v) {
    sort(all(v)); v.erase(unique(all(v)),end(v)); }

// INPUT
template<class A> void re(complex<A>& c);
template<class A, class B> void re(pair<A,B>& p);
template<class A> void re(vector<A>& v);
template<class A, size_t SZ> void re(array<A,SZ>& a);

template<class T> void re(T& x) { cin >> x; }
void re(db& d) { str t; re(t); d = stod(t); }
void re(ld& d) { str t; re(t); d = stold(t); }
template<class H, class... T> void re(H& h, T&... t) { re(h); re(t...); }

template<class A> void re(complex<A>& c) { A a,b; re(a,b); c = {a,b}; }
template<class A, class B> void re(pair<A,B>& p) { re(p.f,p.s); }
template<class A> void re(vector<A>& x) { trav(a,x) re(a); }
template<class A, size_t SZ> void re(array<A,SZ>& x) { trav(a,x) re(a); }

// TO_STRING
#define ts to_string
str ts(char c) { return str(1,c); }
str ts(const char* s) { return (str)s; }
str ts(str s) { return s; }
str ts(bool b) {
#ifdef LOCAL
    return b ? "true" : "false";
#else
    return ts((int)b);
#endif
}
template<class A> str ts(complex<A> c) {
    stringstream ss; ss << c; return ss.str(); }
str ts(vector<bool> v) {
    str res = "{"; F0R(i,sz(v)) res += char('0'+v[i]);
    res += "}"; return res; }
template<size_t SZ> str ts(bitset<SZ> b) {
    str res = ""; F0R(i,SZ) res += char('0'+b[i]);
    return res; }
template<class A, class B> str ts(pair<A,B> p);
template<class T> str ts(T v) { // containers with begin(), end()
#ifdef LOCAL
    bool fst = 1; str res = "{";
		for (const auto& x: v) {
			if (!fst) res += ", ";
			fst = 0; res += ts(x);
		}
		res += "}"; return res;
#else
    bool fst = 1; str res = "";
    for (const auto& x: v) {
        if (!fst) res += " ";
        fst = 0; res += ts(x);
    }
    return res;

#endif
}
template<class A, class B> str ts(pair<A,B> p) {
#ifdef LOCAL
    return "("+ts(p.f)+", "+ts(p.s)+")";
#else
    return ts(p.f)+" "+ts(p.s);
#endif
}

// OUTPUT
template<class A> void pr(A x) { cout << ts(x); }
template<class H, class... T> void pr(const H& h, const T&... t) {
    pr(h); pr(t...); }
void ps() { pr("\n"); } // print w/ spaces
template<class H, class... T> void ps(const H& h, const T&... t) {
    pr(h); if (sizeof...(t)) pr(" "); ps(t...); }

// DEBUG
void DBG() { cerr << "]" << endl; }
template<class H, class... T> void DBG(H h, T... t) {
    cerr << ts(h); if (sizeof...(t)) cerr << ", ";
    DBG(t...); }

//    #define LOCAL

#ifdef LOCAL // compile with -DLOCAL
#define dbg(...) cerr << "LINE(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#else
#define dbg(...) 0
#endif

// FILE I/O
void setIn(str s) { freopen(s.c_str(),"r",stdin); }
void setOut(str s) { freopen(s.c_str(),"w",stdout); }
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); }
void setIO(str s = "") {
    unsyncIO();
    // cin.exceptions(cin.failbit);
    // throws exception when do smth illegal
    // ex. try to read letter into int
    if (sz(s)) { setIn(s+".in"), setOut(s+".out"); } // for USACO
}

int binarySearch(int i, int l, int r, vector<int> arr, int maxTime) {
    while(l<r)
    {
        int mid=(l+r)>>1;
        mid++;
        dbg(l, r, mid);
        if(arr[mid] - arr[i] <= maxTime) {
            l = mid;
        }
        else r=mid-1;
    }
    return l;
}

int longestSequence(vector<int> prefixSum, int maxBooks, int maxTime) {
    int maxCount = 0;
    dbg(maxCount);
    for (int i = 0; i < maxBooks; i++) {
        int j = binarySearch(i, i, maxBooks, prefixSum, maxTime);
        if (j != -1) {
            maxCount = max(j - i, maxCount);
            //dbg(j, maxCount);
        }
        dbg(i, j, maxCount);
    }
    return maxCount;
}

int main() {
    int n, t;
    re(n, t);

    vector<int> minutes(n,0);
    vector<int> prefixSum(n + 1,0);

    F0R(i, n) {
        re(minutes[i]);
        prefixSum[i + 1] = prefixSum[i] + minutes[i];
    }
    dbg(prefixSum);
    int x = longestSequence(prefixSum, n, t);
    pr(x);
}

/* stuff you should look for
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* WRITE STUFF DOWN
*/


#include <fstream>
#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
#include <random>
#include <math.h>
#include <complex>
#include <set>
#include <string>
#include <bitset>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef double db;
typedef string str;

typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef pair<db,db> pd;

typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<db> vd;
typedef vector<str> vs;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<pd> vpd;

#define mp make_pair
#define f first
#define s second
#define sz(x) (int)(x).size()
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define rsz resize
#define ins insert
#define ft front()
#define bk back()
#define pf push_front
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)

const int MOD = 1e9+7; // 998244353;
const int MX = 2e5+5;
const ll INF = 1e18;
const ld PI = acos((ld)-1);
const int xd[4] = {1,0,-1,0}, yd[4] = {0,1,0,-1};
//mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());

template<class T> bool ckmin(T& a, const T& b) {
    return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) {
    return a < b ? a = b, 1 : 0; }
constexpr int pct(int x) { return __builtin_popcount(x); }
constexpr int bits(int x) { return 31-__builtin_clz(x); } // floor(log2(x))
ll cdiv(ll a, ll b) { return a/b+((a^b)>0&&a%b); } // divide a by b rounded up
ll fdiv(ll a, ll b) { return a/b-((a^b)<0&&a%b); } // divide a by b rounded down
ll half(ll x) { return fdiv(x,2); }

template<class T, class U> T fstTrue(T lo, T hi, U f) {
    hi ++; assert(lo <= hi); // assuming f is increasing
    while (lo < hi) { // find first index such that f is true
        T mid = half(lo+hi);
        f(mid) ? hi = mid : lo = mid+1;
    }
    return lo;
}
template<class T, class U> T lstTrue(T lo, T hi, U f) {
    lo --; assert(lo <= hi); // assuming f is decreasing
    while (lo < hi) { // find first index such that f is true
        T mid = half(lo+hi+1);
        f(mid) ? lo = mid : hi = mid-1;
    }
    return lo;
}
template<class T> void remDup(vector<T>& v) {
    sort(all(v)); v.erase(unique(all(v)),end(v)); }

// INPUT
template<class A> void re(complex<A>& c);
template<class A, class B> void re(pair<A,B>& p);
template<class A> void re(vector<A>& v);
template<class A, size_t SZ> void re(array<A,SZ>& a);

template<class T> void re(T& x) { cin >> x; }
void re(db& d) { str t; re(t); d = stod(t); }
void re(ld& d) { str t; re(t); d = stold(t); }
template<class H, class... T> void re(H& h, T&... t) { re(h); re(t...); }

template<class A> void re(complex<A>& c) { A a,b; re(a,b); c = {a,b}; }
template<class A, class B> void re(pair<A,B>& p) { re(p.f,p.s); }
template<class A> void re(vector<A>& x) { trav(a,x) re(a); }
template<class A, size_t SZ> void re(array<A,SZ>& x) { trav(a,x) re(a); }

// TO_STRING
#define ts to_string
str ts(char c) { return str(1,c); }
str ts(const char* s) { return (str)s; }
str ts(str s) { return s; }
str ts(bool b) {
#ifdef LOCAL
    return b ? "true" : "false";
#else
    return ts((int)b);
#endif
}
template<class A> str ts(complex<A> c) {
    stringstream ss; ss << c; return ss.str(); }
str ts(vector<bool> v) {
    str res = "{"; F0R(i,sz(v)) res += char('0'+v[i]);
    res += "}"; return res; }
template<size_t SZ> str ts(bitset<SZ> b) {
    str res = ""; F0R(i,SZ) res += char('0'+b[i]);
    return res; }
template<class A, class B> str ts(pair<A,B> p);
template<class T> str ts(T v) { // containers with begin(), end()
#ifdef LOCAL
    bool fst = 1; str res = "{";
		for (const auto& x: v) {
			if (!fst) res += ", ";
			fst = 0; res += ts(x);
		}
		res += "}"; return res;
#else
    bool fst = 1; str res = "";
    for (const auto& x: v) {
        if (!fst) res += " ";
        fst = 0; res += ts(x);
    }
    return res;

#endif
}
template<class A, class B> str ts(pair<A,B> p) {
#ifdef LOCAL
    return "("+ts(p.f)+", "+ts(p.s)+")";
#else
    return ts(p.f)+" "+ts(p.s);
#endif
}

// OUTPUT
template<class A> void pr(A x) { cout << ts(x); }
template<class H, class... T> void pr(const H& h, const T&... t) {
    pr(h); pr(t...); }
void ps() { pr("\n"); } // print w/ spaces
template<class H, class... T> void ps(const H& h, const T&... t) {
    pr(h); if (sizeof...(t)) pr(" "); ps(t...); }

// DEBUG
void DBG() { cerr << "]" << endl; }
template<class H, class... T> void DBG(H h, T... t) {
    cerr << ts(h); if (sizeof...(t)) cerr << ", ";
    DBG(t...); }

#define LOCAL

#ifdef LOCAL // compile with -DLOCAL
#define dbg(...) cerr << "LINE(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#else
#define dbg(...) 0
#endif

// FILE I/O
void setIn(str s) { freopen(s.c_str(),"r",stdin); }
void setOut(str s) { freopen(s.c_str(),"w",stdout); }
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); }
void setIO(str s = "") {
    unsyncIO();
    // cin.exceptions(cin.failbit);
    // throws exception when do smth illegal
    // ex. try to read letter into int
    if (sz(s)) { setIn(s+".in"), setOut(s+".out"); } // for USACO
}

bool viable(int l, int r, vector<int> arr, int maxTime) {
    int sum = 0;
    int x = 0;
    dbg(r);
    for (int i = l; i <= r; i++) {
        sum += arr[i];
        x++;
    }
    if (sum <= maxTime) {
        return true;
    }
    return false;
}

int binarySearch(int l, int r, vector<int> arr, int maxTime) {
    int old = -1;
    while (l <= r) {
        if (old == r) {
            return -1;
        }
        if (viable(l, r, arr, maxTime)) {
            return r;
        }
        else {
            int mid = (l + r)/2;
            r = mid;
            old = r;
        }
    }
    return -1;
}

int longestSequence(vector<int> minutes, int maxBooks, int maxTime) {
    int maxCount = 0;
    dbg(maxCount);
    for (int i = 0; i < maxBooks; i++) {
        int j = binarySearch(i, maxBooks - 1, minutes, maxTime);
        dbg(i, j, maxCount);
        if (j != -1) {
            maxCount = max(j - i + 1, maxCount);
            dbg(j, maxCount);
        }
    }
    return maxCount;
}

int main() {
    int n, t;
    re(n, t);

    vector<int> minutes;
    minutes.resize(n);

    F0R(i, n) {
        re(minutes[i]);
    }

    int x = longestSequence(minutes, n, t);
    pr(x);
}

/* stuff you should look for
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* WRITE STUFF DOWN
*/


#include <bits/stdc++.h>

#define pi 3.14159265359
#define mod 1000000007
#define newLine cout << "\n";
#define pb push_back
#define mp make_pair
#define loop(i,A,B) for(auto i=A;i<B;i++)
#define rloop(i,B,A) for(auto i=B;i>A;i--)
#define iterate(A) for (auto &i : A)
#define fastInput ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;

typedef long long ll;

int main() {
	fastInput
	int n; ll t; cin >> n >> t;
	vector<int> book(n);
	loop(i, 0, n)
		cin >> book[i];
	int bestSol = 0;
	loop(i, 0, n)
	{
		int currentSol = 1;
		if(t - book[i] < 0)
			continue;
		ll time = t - book[i];
		loop(j, i + 1, n)
		{
			if(time - book[j % n] < 0)
				break;
			time -= book[j % n];
			currentSol++;
		}
		bestSol = (bestSol < currentSol ? currentSol : bestSol);
	}
	cout << bestSol;
	return 0;
}


#include <bits/stdc++.h>

#define pi 3.14159265359
#define mod 1000000007
#define newLine cout << "\n";
#define pb push_back
#define mp make_pair
#define loop(i,A,B) for(auto i=A;i<B;i++)
#define rloop(i,B,A) for(auto i=B;i>A;i--)
#define iterate(A) for (auto &i : A)
#define fastInput ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;

typedef long long ll;

int main() {
	fastInput
	int n; ll t; cin >> n >> t;
	vector<int> book(n);
	loop(i, 0, n)
		cin >> book[i];
	int bestSol = 0;
	loop(i, 0, n)
	{
		int currentSol = 1;
		if(t - book[i] < 0)
			continue;
		ll time = t - book[i];
		loop(j, i + 1, n)
		{
			if(time - book[j % n] < 0)
				break;
			time -= book[j % n];
			currentSol++;
		}
		bestSol = (bestSol < currentSol ? currentSol : bestSol);
		if(bestSol >=  ceil(n/2))
			break;
	}
	cout << bestSol;
	return 0;
}


#include <bits/stdc++.h>

#define pi 3.14159265359
#define mod 1000000007
#define newLine cout << "\n";
#define pb push_back
#define mp make_pair
#define loop(i,A,B) for(auto i=A;i<B;i++)
#define rloop(i,B,A) for(auto i=B;i>A;i--)
#define iterate(A) for (auto &i : A)
#define fastInput ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;

typedef long long ll;

int checkWinner(string s) {
	if ((s.size() == 2 && s[0] == s[1]) || s.size() == 1) {
		return 0;
	}
	loop(i, 1, s.size() - 1)
	{
		if (s[i - 1] == s[i] || s[i - 1] == s[i + 1]) {
			return i;
		}
	}
	return -1;
}

int main() {
	fastInput
	string s;
	cin >> s;
	if (checkWinner(s) != -1)
		cout << "First";
	else {
		sort(s.begin(), s.end());
		int x = checkWinner(s);
		if (x != -1)
			s.erase(s.begin() + x);
		if (checkWinner(s) != -1)
			cout << "Second";
		else
		{
			if(s.size() % 2 == 0)
				cout << "First";
			else
				cout << "Second";
		}
	}
	return 0;
}


#include <bits/stdc++.h>

#define pi 3.14159265359
#define mod 1000000007
#define newLine cout << "\n";
#define pb push_back
#define mp make_pair
#define loop(i,A,B) for(auto i=A;i<B;i++)
#define rloop(i,B,A) for(auto i=B;i>A;i--)
#define iterate(A) for (auto &i : A)
#define fastInput ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;

typedef long long ll;

int main() {
	fastInput
	int n; ll t; cin >> n >> t;
	vector<int> book(n);
	loop(i, 0, n)
		cin >> book[i];
	int bestSol = 0, i = 0;
	queue<int> readBooks;
	while(i != n * 2)
	{
		while(t - book[i % n] < 0 && !readBooks.empty())
		{
			t += readBooks.front();
			bestSol = (bestSol < readBooks.size() ? readBooks.size() : bestSol);
			readBooks.pop();
		}
		if(readBooks.empty() && t -book[i % n] < 0)
				continue;
		t -= book[i % n];
		readBooks.push(book[i % n]);
		i++;
	}
	cout << bestSol;
	return 0;
}


#include <bits/stdc++.h>

#define pi 3.14159265359
#define mod 1000000007
#define newLine cout << "\n";
#define pb push_back
#define mp make_pair
#define loop(i,A,B) for(auto i=A;i<B;i++)
#define rloop(i,B,A) for(auto i=B;i>A;i--)
#define iterate(A) for (auto &i : A)
#define fastInput ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;

typedef long long ll;

int main() {
	fastInput
	int n; ll t; cin >> n >> t;
	vector<int> book(n);
	loop(i, 0, n)
		cin >> book[i];
	int bestSol = 0, i = 0, front = -1;
	queue<int> readBooks;
	while(i != n * 2)
	{
		if(t - book[i % n] < 0)
		{
			t += readBooks.front();
			bestSol = (bestSol < readBooks.size() ? readBooks.size() : bestSol);
			readBooks.pop();
		}
		else
		{
			t -= book[i % n];
			readBooks.push(book[i % n]);
		}
		i++;
	}
	cout << bestSol;
	return 0;
}


#include <bits/stdc++.h>

#define pi 3.14159265359
#define mod 1000000007
#define newLine cout << "\n";
#define pb push_back
#define mp make_pair
#define loop(i,A,B) for(auto i=A;i<B;i++)
#define rloop(i,B,A) for(auto i=B;i>A;i--)
#define iterate(A) for (auto &i : A)
#define fastInput ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;

typedef long long ll;

int main() {
	fastInput
	int n; ll t; cin >> n >> t;
	vector<int> book(n);
	loop(i, 0, n)
		cin >> book[i];
	int bestSol = 0, i = 0;
	queue<int> readBooks;
	while(i != n * n && bestSol != n)
	{
		while(t - book[i % n] < 0 && !readBooks.empty())
		{
			t += readBooks.front();
			bestSol = (bestSol < readBooks.size() ? readBooks.size() : bestSol);
			readBooks.pop();
		}
		if(readBooks.empty() && t -book[i % n] < 0)
		{
			i++;
			continue;
		}
		t -= book[i % n];
		readBooks.push(book[i % n]);

		if(readBooks.size() == n || t == 0)
			bestSol = (bestSol < readBooks.size() ? readBooks.size() : bestSol);

		i++;
	}
	cout << bestSol;
	return 0;
}


#include <bits/stdc++.h>

#define pi 3.14159265359
#define mod 1000000007
#define newLine cout << "\n";
#define pb push_back
#define mp make_pair
#define loop(i,A,B) for(auto i=A;i<B;i++)
#define rloop(i,B,A) for(auto i=B;i>A;i--)
#define iterate(A) for (auto &i : A)
#define fastInput ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;

typedef long long ll;

int main() {
	fastInput
	int n; ll t; cin >> n >> t;
	vector<int> book(n);
	loop(i, 0, n)
		cin >> book[i];
	int bestSol = 0, i = 0;
	queue<int> readBooks;
	while(i != n * n)
	{
		while(t - book[i % n] < 0 && !readBooks.empty())
		{
			t += readBooks.front();
			bestSol = (bestSol < readBooks.size() ? readBooks.size() : bestSol);
			readBooks.pop();
		}
		t -= book[i % n];
		readBooks.push(book[i % n]);
		i++;
	}
	cout << bestSol;
	return 0;
}


#include <bits/stdc++.h>

#define pi 3.14159265359
#define mod 1000000007
#define newLine cout << "\n";
#define pb push_back
#define mp make_pair
#define loop(i,A,B) for(auto i=A;i<B;i++)
#define rloop(i,B,A) for(auto i=B;i>A;i--)
#define iterate(A) for (auto &i : A)
#define fastInput ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;

typedef long long ll;

int main() {
	fastInput
	int n; ll t; cin >> n >> t;
	vector<int> book(n);
	loop(i, 0, n)
		cin >> book[i];
	int bestSol = 0, i = 0;
	queue<int> readBooks;
	while(i != n * n && bestSol != n)
	{
		while(t - book[i % n] < 0 && !readBooks.empty())
		{
			t += readBooks.front();
			bestSol = (bestSol < readBooks.size() ? readBooks.size() : bestSol);
			readBooks.pop();
		}
		if(readBooks.empty() && t -book[i % n] < 0)
		{
			i++;
			continue;
		}
		t -= book[i % n];
		readBooks.push(book[i % n]);
		i++;
	}
	cout << bestSol;
	return 0;
}


#include <bits/stdc++.h>

#define pi 3.14159265359
#define mod 1000000007
#define newLine cout << "\n";
#define pb push_back
#define mp make_pair
#define loop(i,A,B) for(auto i=A;i<B;i++)
#define rloop(i,B,A) for(auto i=B;i>A;i--)
#define iterate(A) for (auto &i : A)
#define fastInput ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;

typedef long long ll;

int main() {
	fastInput
	int n; ll t; cin >> n >> t;
	vector<int> book(n);
	loop(i, 0, n)
		cin >> book[i];
	int bestSol = 0, i = 0;
	queue<int> readBooks;
	while(i != n * 2)
	{
		while(t - book[i % n] < 0 && !readBooks.empty())
		{
			t += readBooks.front();
			bestSol = (bestSol < readBooks.size() ? readBooks.size() : bestSol);
			readBooks.pop();
		}
		if(readBooks.empty() && t -book[i % n] < 0)
		{
			i++;
			continue;
		}
		t -= book[i % n];
		readBooks.push(book[i % n]);
		i++;
	}
	cout << bestSol;
	return 0;
}


#include <bits/stdc++.h>

#define pi 3.14159265359
#define mod 1000000007
#define newLine cout << "\n";
#define pb push_back
#define mp make_pair
#define loop(i,A,B) for(auto i=A;i<B;i++)
#define rloop(i,B,A) for(auto i=B;i>A;i--)
#define iterate(A) for (auto &i : A)
#define fastInput ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;

typedef long long ll;

int main() {
	fastInput
	int n; ll t; cin >> n >> t;
	vector<int> book(n);
	loop(i, 0, n)
		cin >> book[i];
	int bestSol = 0, i = 0;
	queue<int> readBooks;
	while(i != n * n && bestSol != n)
	{
		while(t - book[i % n] < 0 && !readBooks.empty())
		{
			t += readBooks.front();
			bestSol = (bestSol < readBooks.size() ? readBooks.size() : bestSol);
			readBooks.pop();
		}
		if(readBooks.empty() && t -book[i % n] < 0)
		{
			i++;
			continue;
		}
		t -= book[i % n];
		readBooks.push(book[i % n]);
		if(readBooks.size() == n)
			bestSol = n;
		i++;
	}
	cout << bestSol;
	return 0;
}


#include <bits/stdc++.h>

#define pi 3.14159265359
#define mod 1000000007
#define newLine cout << "\n";
#define pb push_back
#define mp make_pair
#define loop(i,A,B) for(auto i=A;i<B;i++)
#define rloop(i,B,A) for(auto i=B;i>A;i--)
#define iterate(A) for (auto &i : A)
#define fastInput ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;

typedef long long ll;

int main() {
	fastInput
	int n; ll t; cin >> n >> t;
	vector<int> book(n);
	loop(i, 0, n)
		cin >> book[i];
	int bestSol = 0, i = 0, front = -1;
	queue<int> readBooks;
	while(i != n * n)
	{
		if(t - book[i % n] < 0)
		{
			t += readBooks.front();
			bestSol = (bestSol < readBooks.size() ? readBooks.size() : bestSol);
			readBooks.pop();
		}
		else
		{
			t -= book[i % n];
			readBooks.push(book[i % n]);
		}
		i++;
	}
	cout << bestSol;
	return 0;
}


#include <bits/stdc++.h>

#define pi 3.14159265359
#define mod 1000000007
#define newLine cout << "\n";
#define pb push_back
#define mp make_pair
#define loop(i,A,B) for(auto i=A;i<B;i++)
#define rloop(i,B,A) for(auto i=B;i>A;i--)
#define iterate(A) for (auto &i : A)
#define fastInput ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;

typedef long long ll;

int main() {
	fastInput
	int n; ll t; cin >> n >> t;
	vector<int> book(n);
	loop(i, 0, n)
		cin >> book[i];
	int bestSol = 0, i = 0;
	queue<int> readBooks;
	while(i != n * n)
	{
		while(t - book[i % n] < 0 || !readBooks.empty())
		{
			t += readBooks.front();
			bestSol = (bestSol < readBooks.size() ? readBooks.size() : bestSol);
			readBooks.pop();
		}
		t -= book[i % n];
		readBooks.push(book[i % n]);
		i++;
	}
	cout << bestSol;
	return 0;
}


#include <bits/stdc++.h>

#define pi 3.14159265359
#define mod 1000000007
#define nline cout << "\n";
#define pb push_back
#define mp make_pair
#define loop(i,A,B) for(auto i=A;i<B;i++)
#define rloop(i,B,A) for(auto i=B;i>A;i--)
#define iterate(A) for (auto &i : A)
#define fastInput ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;

typedef long long ll;

int main() {
	fastInput
	int n; ll t; cin >> n >> t;
	vector<int> book(n);
	loop(i, 0, n)
		cin >> book[i];
	int bestSol = 0, i = 0;
	queue<int> readBooks;
	while(i != 2 * n && bestSol != n)
	{
		while(t - book[i % n] < 0 && !readBooks.empty())
		{
			bestSol = (bestSol < readBooks.size() ? readBooks.size() : bestSol);
			t += readBooks.front();
			readBooks.pop();
		}
		if(readBooks.empty() && t - book[i % n] < 0)
		{
			i++;
			continue;
		}
		t -= book[i % n];
		readBooks.push(book[i % n]);
		bestSol = (bestSol < readBooks.size() ? readBooks.size() : bestSol);
		i++;
	}
	cout << bestSol;
	return 0;
}


#include <bits/stdc++.h>

#define pi 3.14159265359
#define mod 1000000007
#define newLine cout << "\n";
#define pb push_back
#define mp make_pair
#define loop(i,A,B) for(auto i=A;i<B;i++)
#define rloop(i,B,A) for(auto i=B;i>A;i--)
#define iterate(A) for (auto &i : A)
#define fastInput ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

using namespace std;

typedef long long ll;

int main() {
	fastInput
	int n; ll t; cin >> n >> t;
	vector<int> book(n);
	loop(i, 0, n)
		cin >> book[i];
	int bestSol = 0, i = 0;
	queue<int> readBooks;
	while(i != n * n)
	{
		while(t - book[i % n] < 0 && !readBooks.empty())
		{
			t += readBooks.front();
			bestSol = (bestSol < readBooks.size() ? readBooks.size() : bestSol);
			readBooks.pop();
		}
		if(readBooks.empty() && t -book[i % n] < 0)
				continue;
		t -= book[i % n];
		readBooks.push(book[i % n]);
		i++;
	}
	cout << bestSol;
	return 0;
}


#include <bits/stdc++.h>
#include <unordered_map>

#define ll long long

using namespace std;

int n,m;
double x;

const int inf=0xfffff;
const int N = 55;
int  pre[N];

double maxflow,dp[N][N];

int tmp[N][N];

double Path[1000010];
int pathCnt = 0;

void Edmonds_Karp(int start, int end, int m){
    while(1){
        queue<int> p;
        double minflow = inf;
        p.push(1);                //Դ��Ϊ1������
        memset(pre, 0, sizeof(pre));//��ʼ������·�����飬��Ŀ�еĶ����Ǵ�1��ʼ��
        while(!p.empty()){      //bfs������·
            int u = p.front();
            p.pop();
            if(u == end)
                break;
            for(int i = 1;i <= m;i++)
                if(dp[u][i] > 0&&pre[i] == 0){ //pre[i]���˼�¼��ǰ����ĸ��ף�����¼��ǰ������û�����ʹ�
                    pre[i] = u;
                    p.push(i);
                }
        }
        if(pre[end] == 0)                   //����ĸ���Ϊ�գ���ʾ�Ҳ�������·�����������ɡ���
            break;
        for(int i = end;i != start;i = pre[i])  //�ҳ�����·����С������
            minflow = min(minflow, dp[pre[i]][i]);
        for(int i = end;i != start;i = pre[i])  {
            dp[pre[i]][i] -= minflow;           //��������·�������򻡵�����
            dp[i][pre[i]] += minflow;
        }
		maxflow+=minflow;
    }
}

int main(){
	cin>>n>>m>>x;

	for(int i=1;i<=m;i++){
		int a,b,c;
		scanf("%d%d%d",&a,&b,&c);
		dp[a][b]+=c;
	}

	memcpy(tmp,dp,sizeof(dp));

	double l=0;
	double r=1000000;

	double mid = 0;

	for(int tt=0;tt<100;tt++){
		mid = (l+r)/2;
		memcpy(dp,tmp,sizeof(dp));
		for(int i=0;i<=n;i++){
			for(int j=0;j<=n;j++){
				dp[i][j] = (dp[i][j]/mid);
			}
		}
		maxflow = 0;
		Edmonds_Karp(1,n,n);

//		cout<<"mid = "<<mid<<" mf = "<<maxflow<<endl;
		if(maxflow>=x){
			l=mid;
		}else{
			r=mid;
		}
	}

	//cout<<maxflow<<endl;
	printf("%.10f\n",mid*x);

	return 0;
}


#include <bits/stdc++.h>
#include <unordered_map>

#define ll long long

using namespace std;

int n,m;
double x;

const int inf=0xfffff;
const int N = 55;
int  pre[N];

double maxflow,dp[N][N];

int tmp[N][N];

double Path[1000010];
int pathCnt = 0;

void Edmonds_Karp(int start, int end, int m){
    while(1){
        queue<int> p;
        double minflow = inf;
        p.push(1);                //Դ��Ϊ1������
        memset(pre, 0, sizeof(pre));//��ʼ������·�����飬��Ŀ�еĶ����Ǵ�1��ʼ��
        while(!p.empty()){      //bfs������·
            int u = p.front();
            p.pop();
            if(u == end)
                break;
            for(int i = 1;i <= m;i++)
                if(dp[u][i] > 0&&pre[i] == 0){ //pre[i]���˼�¼��ǰ����ĸ��ף�����¼��ǰ������û�����ʹ�
                    pre[i] = u;
                    p.push(i);
                }
        }
        if(pre[end] == 0)                   //����ĸ���Ϊ�գ���ʾ�Ҳ�������·�����������ɡ���
            break;
        for(int i = end;i != start;i = pre[i])  //�ҳ�����·����С������
            minflow = min(minflow, dp[pre[i]][i]);
        for(int i = end;i != start;i = pre[i])  {
            dp[pre[i]][i] -= minflow;           //��������·�������򻡵�����
            dp[i][pre[i]] += minflow;
        }
		maxflow+=minflow;
    }
}

int main(){
	cin>>n>>m>>x;

	for(int i=1;i<=m;i++){
		int a,b,c;
		scanf("%d%d%d",&a,&b,&c);
		dp[a][b]+=c;
	}

	memcpy(tmp,dp,sizeof(dp));

	double l=0;
	double r=1000000;

	double mid = 0;

	for(int tt=0;tt<100;tt++){
		mid = (l+r)/2;
		memcpy(dp,tmp,sizeof(dp));
		for(int i=0;i<=n;i++){
			for(int j=0;j<=n;j++){
				dp[i][j] = floor(dp[i][j]/mid);
			}
		}
		maxflow = 0;
		Edmonds_Karp(1,n,n);

//		cout<<"mid = "<<mid<<" mf = "<<maxflow<<endl;
		if(maxflow>=x){
			l=mid;
		}else{
			r=mid;
		}
	}

	//cout<<maxflow<<endl;
	printf("%.10f\n",mid*x);

	return 0;
}


#include <bits/stdc++.h>
#include <unordered_map>

#define ll long long

using namespace std;

int n,m;
double x;

const int inf=0xfffff;
const int N = 55;
int  pre[N];

double maxflow,dp[N][N];

double tmp[N][N];

double Path[1000010];
int pathCnt = 0;

void Edmonds_Karp(int start, int end, int m){
    while(1){
        queue<int> p;
        double minflow = inf;
        p.push(1);                //Դ��Ϊ1������
        memset(pre, 0, sizeof(pre));//��ʼ������·�����飬��Ŀ�еĶ����Ǵ�1��ʼ��
        while(!p.empty()){      //bfs������·
            int u = p.front();
            p.pop();
            if(u == end)
                break;
            for(int i = 1;i <= m;i++)
                if(dp[u][i] > 0&&pre[i] == 0){ //pre[i]���˼�¼��ǰ����ĸ��ף�����¼��ǰ������û�����ʹ�
                    pre[i] = u;
                    p.push(i);
                }
        }
        if(pre[end] == 0)                   //����ĸ���Ϊ�գ���ʾ�Ҳ�������·�����������ɡ���
            break;
        for(int i = end;i != start;i = pre[i])  //�ҳ�����·����С������
            minflow = min(minflow, dp[pre[i]][i]);
        for(int i = end;i != start;i = pre[i])  {
            dp[pre[i]][i] -= minflow;           //��������·�������򻡵�����
            dp[i][pre[i]] += minflow;
        }
		maxflow+=minflow;
    }
}

int main(){
	cin>>n>>m>>x;

	for(int i=1;i<=m;i++){
		int a,b,c;
		scanf("%d%d%d",&a,&b,&c);
		dp[a][b]+=c;
	}

	memcpy(tmp,dp,sizeof(dp));

	double l=0;
	double r=1000000;

	double mid = 0;

	for(int tt=0;tt<66;tt++){
		mid = (l+r)/2;
		memcpy(dp,tmp,sizeof(dp));
		for(int i=0;i<=n;i++){
			for(int j=0;j<=n;j++){
				dp[i][j] = floor(dp[i][j]/mid);
			}
		}
		maxflow = 0;
		Edmonds_Karp(1,n,n);

//		cout<<"mid = "<<mid<<" mf = "<<maxflow<<endl;
		if(maxflow>=x){
			l=mid;
		}else{
			r=mid;
		}
	}

	//cout<<maxflow<<endl;
	printf("%.10f\n",mid*x);

	return 0;
}


#include <bits/stdc++.h>
#include <unordered_map>

#define ll long long

using namespace std;

int n,m,x;

const int inf=0xfffff;
const int N = 55;
int  pre[N];

int maxflow,dp[N][N];

int tmp[N][N];

double Path[1000010];
int pathCnt = 0;

void Edmonds_Karp(int start, int end, int m){
    while(1){
        queue<int> p;
        double minflow = inf;
        p.push(1);                //Դ��Ϊ1������
        memset(pre, 0, sizeof(pre));//��ʼ������·�����飬��Ŀ�еĶ����Ǵ�1��ʼ��
        while(!p.empty()){      //bfs������·
            int u = p.front();
            p.pop();
            if(u == end)
                break;
            for(int i = 1;i <= m;i++)
                if(dp[u][i] > 0&&pre[i] == 0){ //pre[i]���˼�¼��ǰ����ĸ��ף�����¼��ǰ������û�����ʹ�
                    pre[i] = u;
                    p.push(i);
                }
        }
        if(pre[end] == 0)                   //����ĸ���Ϊ�գ���ʾ�Ҳ�������·�����������ɡ���
            break;
        for(int i = end;i != start;i = pre[i])  //�ҳ�����·����С������
            minflow = min(minflow, dp[pre[i]][i]);
        for(int i = end;i != start;i = pre[i])  {
            dp[pre[i]][i] -= minflow;           //��������·�������򻡵�����
            dp[i][pre[i]] += minflow;
        }
		maxflow+=minflow;
    }
}

int main(){
	cin>>n>>m>>x;

	for(int i=1;i<=m;i++){
		int a,b,c;
		scanf("%d%d%d",&a,&b,&c);
		dp[a][b]+=c;
	}

	memcpy(tmp,dp,sizeof(dp));

	double l=0;
	double r=1000000;

	double mid = 0;

	for(int tt=0;tt<60;tt++){
		mid = (l+r)/2;
		memcpy(dp,tmp,sizeof(dp));
		for(int i=0;i<=n;i++){
			for(int j=0;j<=n;j++){
				dp[i][j] = (dp[i][j]/mid);
			}
		}
		maxflow = 0;
		Edmonds_Karp(1,n,n);

		//cout<<"mid = "<<mid<<" mf = "<<maxflow<<endl;
		if(maxflow>=x){
			l=mid;
		}else{
			r=mid;
		}
	}

	//cout<<maxflow<<endl;
	printf("%.10f\n",mid*x);

	return 0;
}


#include <bits/stdc++.h>
#include <unordered_map>

#define ll long long

using namespace std;

int n,m,x;

const int inf=0xfffff;
const int N = 55;
int  pre[N];

double maxflow,dp[N][N];

double tmp[N][N];

double Path[1000010];
int pathCnt = 0;

void Edmonds_Karp(int start, int end, int m){
    while(1){
        queue<int> p;
        double minflow = inf;
        p.push(1);                //Դ��Ϊ1������
        memset(pre, 0, sizeof(pre));//��ʼ������·�����飬��Ŀ�еĶ����Ǵ�1��ʼ��
        while(!p.empty()){      //bfs������·
            int u = p.front();
            p.pop();
            if(u == end)
                break;
            for(int i = 1;i <= m;i++)
                if(dp[u][i] > 0&&pre[i] == 0){ //pre[i]���˼�¼��ǰ����ĸ��ף�����¼��ǰ������û�����ʹ�
                    pre[i] = u;
                    p.push(i);
                }
        }
        if(pre[end] == 0)                   //����ĸ���Ϊ�գ���ʾ�Ҳ�������·�����������ɡ���
            break;
        for(int i = end;i != start;i = pre[i])  //�ҳ�����·����С������
            minflow = min(minflow, dp[pre[i]][i]);
        for(int i = end;i != start;i = pre[i])  {
            dp[pre[i]][i] -= minflow;           //��������·�������򻡵�����
            dp[i][pre[i]] += minflow;
        }
		maxflow+=minflow;
    }
}

int main(){
	cin>>n>>m>>x;

	for(int i=1;i<=m;i++){
		int a,b,c;
		scanf("%d%d%d",&a,&b,&c);
		dp[a][b]+=c;
	}

	memcpy(tmp,dp,sizeof(dp));

	double l=0;
	double r=1000000;

	double mid = 0;

	for(int tt=0;tt<60;tt++){
		mid = (l+r)/2;
		memcpy(dp,tmp,sizeof(dp));
		for(int i=0;i<=n;i++){
			for(int j=0;j<=n;j++){
				dp[i][j] = (int)(dp[i][j]/mid);
			}
		}
		maxflow = 0;
		Edmonds_Karp(1,n,n);

		//cout<<"mid = "<<mid<<" mf = "<<maxflow<<endl;
		if(maxflow>=x){
			l=mid;
		}else{
			r=mid;
		}
	}

	//cout<<maxflow<<endl;
	printf("%.10f\n",mid*x);

	return 0;
}


#include <bits/stdc++.h>
#include <unordered_map>

#define ll long long

using namespace std;

int n,m,x;

const int inf=0xfffff;
const int N = 330;
int maxflow, pre[N], dp[N][N];

double Path[1000010];
int pathCnt = 0;

void Edmonds_Karp(int start, int end, int m){
    while(1){
        queue<int> p;
        int minflow = inf;
        p.push(1);                //Դ��Ϊ1������
        memset(pre, 0, sizeof(pre));//��ʼ������·�����飬��Ŀ�еĶ����Ǵ�1��ʼ��
        while(!p.empty()){      //bfs������·
            int u = p.front();
            p.pop();
            if(u == end)
                break;
            for(int i = 1;i <= m;i++)
                if(dp[u][i] > 0&&pre[i] == 0){ //pre[i]���˼�¼��ǰ����ĸ��ף�����¼��ǰ������û�����ʹ�
                    pre[i] = u;
                    p.push(i);
                }
        }
        if(pre[end] == 0)                   //����ĸ���Ϊ�գ���ʾ�Ҳ�������·�����������ɡ���
            break;
        for(int i = end;i != start;i = pre[i])  //�ҳ�����·����С������
            minflow = min(minflow, dp[pre[i]][i]);
        for(int i = end;i != start;i = pre[i])  {
            dp[pre[i]][i] -= minflow;           //��������·�������򻡵�����
            dp[i][pre[i]] += minflow;
        }
        //cout<<"find "<<minflow<<endl;
        if(minflow!=0){
        	Path[pathCnt++] = minflow;
		}
		maxflow+=minflow;
    }
}

bool judge(double xx){

	int cc = 0;

	for(int i=0;i<pathCnt;i++){
		int tmp = (Path[i]/xx)+1;
		double test = tmp*xx;
		while(test>Path[i]){
			test-=xx;
			tmp-=1;
		}
		cc+=tmp;
	}
	return cc>=x;
}

int main(){
	cin>>n>>m>>x;

	for(int i=1;i<=m;i++){
		int a,b,c;
		scanf("%d%d%d",&a,&b,&c);
		dp[a][b]+=c;
	}

	Edmonds_Karp(1,n,n);

	double l=0;
	double r=1000000;

	double mid;

	while(r-l>=0.00000001){
		mid = (l+r)/2;
		if(judge(mid)){
			l=mid;
		}else{
			r=mid;
		}
	}

	//cout<<maxflow<<endl;
	printf("%.7f\n",mid*x);

	return 0;
}


#include <bits/stdc++.h>
#include <unordered_map>

#define ll long long

using namespace std;

int n,m,x;

const int inf=0xfffff;
const int N = 330;
int maxflow, pre[N], dp[N][N];

double Path[1000010];
int pathCnt = 0;

void Edmonds_Karp(int start, int end, int m){
    while(1){
        queue<int> p;
        int minflow = inf;
        p.push(1);                //Դ��Ϊ1������
        memset(pre, 0, sizeof(pre));//��ʼ������·�����飬��Ŀ�еĶ����Ǵ�1��ʼ��
        while(!p.empty()){      //bfs������·
            int u = p.front();
            p.pop();
            if(u == end)
                break;
            for(int i = 1;i <= m;i++)
                if(dp[u][i] > 0&&pre[i] == 0){ //pre[i]���˼�¼��ǰ����ĸ��ף�����¼��ǰ������û�����ʹ�
                    pre[i] = u;
                    p.push(i);
                }
        }
        if(pre[end] == 0)                   //����ĸ���Ϊ�գ���ʾ�Ҳ�������·�����������ɡ���
            break;
        for(int i = end;i != start;i = pre[i])  //�ҳ�����·����С������
            minflow = min(minflow, dp[pre[i]][i]);
        for(int i = end;i != start;i = pre[i])  {
            dp[pre[i]][i] -= minflow;           //��������·�������򻡵�����
            dp[i][pre[i]] += minflow;
        }
        //cout<<"find "<<minflow<<endl;
        if(minflow!=0){
        	Path[pathCnt++] = min(minflow,x);
		}
		maxflow+=minflow;
    }
}

bool judge(double xx){

	int cc = 0;

	for(int i=0;i<pathCnt;i++){
		int tmp = (Path[i]/xx)+2;
		double test = tmp*xx;
		while(test>Path[i]+1e-10){
			test-=xx;
			tmp-=1;
		}
		cc+=tmp;
	}
	return cc>=x;
}

int main(){
	cin>>n>>m>>x;

	for(int i=1;i<=m;i++){
		int a,b,c;
		scanf("%d%d%d",&a,&b,&c);
		dp[a][b]+=c;
	}

	Edmonds_Karp(1,n,n);

	double l=0;
	double r=1000000;

	double mid = 0;

	while(r-l>=0.0000000001){
		mid = (l+r)/2;
		if(judge(mid)){
			l=mid;
		}else{
			r=mid;
		}
	}

	//cout<<maxflow<<endl;
	printf("%.10f\n",mid*x);

	return 0;
}


#include <bits/stdc++.h>
#include <unordered_map>

#define ll long long

using namespace std;

int n,m,x;

const int inf=0xfffff;
const int N = 55;
int  pre[N];

double maxflow,dp[N][N];

double tmp[N][N];

double Path[1000010];
int pathCnt = 0;

void Edmonds_Karp(int start, int end, int m){
    while(1){
        queue<int> p;
        double minflow = inf;
        p.push(1);                //源点为1，进队
        memset(pre, 0, sizeof(pre));//初始化增广路径数组，题目中的顶点是从1开始的
        while(!p.empty()){      //bfs找增广路
            int u = p.front();
            p.pop();
            if(u == end)
                break;
            for(int i = 1;i <= m;i++)
                if(dp[u][i] > 0&&pre[i] == 0){ //pre[i]除了记录当前顶点的父亲，还记录当前顶点有没被访问过
                    pre[i] = u;
                    p.push(i);
                }
        }
        if(pre[end] == 0)                   //顶点的父亲为空，表示找不到增广路，很容易理解吧。。
            break;
        for(int i = end;i != start;i = pre[i])  //找出增广路中最小残余量
            minflow = min(minflow, dp[pre[i]][i]);
        for(int i = end;i != start;i = pre[i])  {
            dp[pre[i]][i] -= minflow;           //更新增广路中正反向弧的流量
            dp[i][pre[i]] += minflow;
        }
		maxflow+=minflow;
    }
}

int main(){
	cin>>n>>m>>x;

	for(int i=1;i<=m;i++){
		int a,b,c;
		scanf("%d%d%d",&a,&b,&c);
		dp[a][b]+=c;
	}

	memcpy(tmp,dp,sizeof(dp));

	double l=0;
	double r=1000000;

	double mid = 0;

	while(r-l>=0.0000000001){
		mid = (l+r)/2;
		memcpy(dp,tmp,sizeof(dp));
		for(int i=0;i<=n;i++){
			for(int j=0;j<=n;j++){
				dp[i][j] = (int)(dp[i][j]/mid);
			}
		}
		maxflow = 0;
		Edmonds_Karp(1,n,n);

		//cout<<"mid = "<<mid<<" mf = "<<maxflow<<endl;
		if(maxflow>=x){
			l=mid;
		}else{
			r=mid;
		}
	}

	//cout<<maxflow<<endl;
	printf("%.10f\n",mid*x);

	return 0;
}


#include <bits/stdc++.h>
#include <unordered_map>

#define ll long long

using namespace std;

int n,m,x;

const int inf=0xfffff;
const int N = 55;
int  pre[N];

double maxflow,dp[N][N];

double tmp[N][N];

double Path[1000010];
int pathCnt = 0;

void Edmonds_Karp(int start, int end, int m){
    while(1){
        queue<int> p;
        double minflow = inf;
        p.push(1);                //Դ��Ϊ1������
        memset(pre, 0, sizeof(pre));//��ʼ������·�����飬��Ŀ�еĶ����Ǵ�1��ʼ��
        while(!p.empty()){      //bfs������·
            int u = p.front();
            p.pop();
            if(u == end)
                break;
            for(int i = 1;i <= m;i++)
                if(dp[u][i] > 0&&pre[i] == 0){ //pre[i]���˼�¼��ǰ����ĸ��ף�����¼��ǰ������û�����ʹ�
                    pre[i] = u;
                    p.push(i);
                }
        }
        if(pre[end] == 0)                   //����ĸ���Ϊ�գ���ʾ�Ҳ�������·�����������ɡ���
            break;
        for(int i = end;i != start;i = pre[i])  //�ҳ�����·����С������
            minflow = min(minflow, dp[pre[i]][i]);
        for(int i = end;i != start;i = pre[i])  {
            dp[pre[i]][i] -= minflow;           //��������·�������򻡵�����
            dp[i][pre[i]] += minflow;
        }
		maxflow+=minflow;
    }
}

int main(){
	cin>>n>>m>>x;

	for(int i=1;i<=m;i++){
		int a,b,c;
		scanf("%d%d%d",&a,&b,&c);
		dp[a][b]+=c;
	}

	memcpy(tmp,dp,sizeof(dp));

	double l=0;
	double r=1000000;

	double mid = 0;

	while(r-l>=0.00000001){
		mid = (l+r)/2;
		memcpy(dp,tmp,sizeof(dp));
		for(int i=0;i<=n;i++){
			for(int j=0;j<=n;j++){
				dp[i][j] = (int)(dp[i][j]/mid);
			}
		}
		maxflow = 0;
		Edmonds_Karp(1,n,n);

		//cout<<"mid = "<<mid<<" mf = "<<maxflow<<endl;
		if(maxflow>=x){
			l=mid;
		}else{
			r=mid;
		}
	}

	//cout<<maxflow<<endl;
	printf("%.10f\n",mid*x);

	return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
const int INF = 1e8;
#define maxn 3333
#define maxm 411111
#define eps 1e-10

int n, m, x, N;
int s, t;
struct Edge
{
    int from, to,next,cap,flow;
    void get(int u,int a,int b,int c,int d)
    {
        from = u; to = a; next = b; cap = c; flow = d;
    }
}edge[maxm];
int tol;
int head[maxn];
int gap[maxn],dep[maxn],pre[maxn],cur[maxn];
void init()
{
    tol=0;
    memset(head,-1,sizeof(head));
}

void add_edge(int u,int v,int w,int rw=0)
{ //cout << u << " " << v << " " << w << endl;
    edge[tol].get(u, v,head[u],w,0);head[u]=tol++;
    edge[tol].get(v, u,head[v],rw,0);head[v]=tol++;
}
int sap(int start,int end,int N)
{
    memset(gap,0,sizeof(gap));
    memset(dep,0,sizeof(dep));
    memcpy(cur,head,sizeof(head));
    int u=start;
    pre[u]=-1;
    gap[0]=N;
    int ans=0;
    while(dep[start]<N)
    {
        if(u==end)
        {
            int Min=INF;
            for(int i=pre[u];i!=-1;i=pre[edge[i^1].to])
                if(Min>edge[i].cap-edge[i].flow)
                   Min=edge[i].cap-edge[i].flow;
            for(int i=pre[u];i!=-1;i=pre[edge[i^1].to])
            {
                edge[i].flow+=Min;
                edge[i^1].flow-=Min;
            }
            u = start;
            ans+=Min;
            continue;
        }
        bool flag=false;
        int v;
        for(int i=cur[u];i !=-1;i=edge[i].next)
        {
            v=edge[i].to;
            if(edge[i].cap-edge[i].flow&&dep[v]+1==dep[u])
            {
                flag=true;
                cur[u]=pre[v]=i;
                break;
            }
        }
        if(flag)
        {
            u=v;
            continue;
        }
        int Min=N;
        for(int i=head[u];i!=-1;i=edge[i].next)
            if(edge[i].cap-edge[i].flow&&dep[edge[i].to]<Min)
        {
            Min=dep[edge[i].to];
            cur[u]=i;
        }
        gap[dep[u]]--;
        if(!gap[dep[u]]) return ans;
        dep[u]=Min+1;
        gap[dep[u]]++;
        if(u!=start) u=edge[pre[u]^1].to;
    }
    return ans;
}

int e[511][3];

bool ok (double num) {//总重量为num的情况下能不能完成
    double per = num/x;//每只熊
    init ();
    s = 0, t = n-1, N = n;
    for (int i = 1; i <= m; i++) {
        int u = e[i][0]-1, v = e[i][1]-1, w = e[i][2];
        int cap = floor (1.0*w/per);
        add_edge (u, v, cap);
    }
    int ans = sap (s, t, N);
    return ans >= x;
}

int main () {
    //freopen ("in.txt", "r", stdin);
    scanf ("%d%d%d", &n, &m, &x);
    for (int i = 1; i <= m; i++) {
        scanf ("%d%d%d", &e[i][0], &e[i][1], &e[i][2]);
    }
    double l = 0.0, r = 1e8;
    while (r-l > eps) {
        double mid = (l+r)/2.0;
        if (ok (mid))
            l = mid;
        else
            r = mid;
    }
    printf ("%.10f\n", ok (r) ? r : l);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
const int INF = 1e8;
#define maxn 55
#define maxm 1111
#define eps 1e-8

int n, m, x, N;
int s, t;
struct Edge
{
    int from, to,next,cap,flow;
    void get(int u,int a,int b,int c,int d)
    {
        from = u; to = a; next = b; cap = c; flow = d;
    }
}edge[maxm];
int tol;
int head[maxn];
int gap[maxn],dep[maxn],pre[maxn],cur[maxn];
void init()
{
    tol=0;
    memset(head,-1,sizeof(head));
}

void add_edge(int u,int v,int w,int rw=0)
{ //cout << u << " " << v << " " << w << endl;
    edge[tol].get(u, v,head[u],w,0);head[u]=tol++;
    edge[tol].get(v, u,head[v],rw,0);head[v]=tol++;
}
int sap(int start,int end,int N)
{
    memset(gap,0,sizeof(gap));
    memset(dep,0,sizeof(dep));
    memcpy(cur,head,sizeof(head));
    int u=start;
    pre[u]=-1;
    gap[0]=N;
    int ans=0;
    while(dep[start]<N)
    {
        if(u==end)
        {
            int Min=INF;
            for(int i=pre[u];i!=-1;i=pre[edge[i^1].to])
                if(Min>edge[i].cap-edge[i].flow)
                   Min=edge[i].cap-edge[i].flow;
            for(int i=pre[u];i!=-1;i=pre[edge[i^1].to])
            {
                edge[i].flow+=Min;
                edge[i^1].flow-=Min;
            }
            u = start;
            ans+=Min;
            continue;
        }
        bool flag=false;
        int v;
        for(int i=cur[u];i !=-1;i=edge[i].next)
        {
            v=edge[i].to;
            if(edge[i].cap-edge[i].flow&&dep[v]+1==dep[u])
            {
                flag=true;
                cur[u]=pre[v]=i;
                break;
            }
        }
        if(flag)
        {
            u=v;
            continue;
        }
        int Min=N;
        for(int i=head[u];i!=-1;i=edge[i].next)
            if(edge[i].cap-edge[i].flow&&dep[edge[i].to]<Min)
        {
            Min=dep[edge[i].to];
            cur[u]=i;
        }
        gap[dep[u]]--;
        if(!gap[dep[u]]) return ans;
        dep[u]=Min+1;
        gap[dep[u]]++;
        if(u!=start) u=edge[pre[u]^1].to;
    }
    return ans;
}

int e[511][3];

bool ok (double num) {//总重量为num的情况下能不能完成
    double per = num/x;//每只熊
    init ();
    s = 0, t = n-1, N = n;
    for (int i = 1; i <= m; i++) {
        int u = e[i][0]-1, v = e[i][1]-1, w = e[i][2];
        int cap = floor (1.0*w/per);
        add_edge (u, v, cap);
    }
    int ans = sap (s, t, N);
    return ans >= x;
}

int main () {
    //freopen ("in.txt", "r", stdin);
    scanf ("%d%d%d", &n, &m, &x);
    double Min = INF;
    for (int i = 1; i <= m; i++) {
        scanf ("%d%d%d", &e[i][0], &e[i][1], &e[i][2]);
        Min = min (Min, e[i][2]);
    }
    double l = Min/x, r = 1e6;
    while (r-l > eps) {
        double mid = (l+r)/2.0;
        if (ok (mid))
            l = mid;
        else
            r = mid;
    }
    printf ("%.10f\n", ok (r) ? r : l);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
const int INF = 1e8;
#define maxn 55
#define maxm 1111
#define eps 1e-9

int n, m, x, N;
int s, t;
struct Edge
{
    int from, to,next,cap,flow;
    void get(int u,int a,int b,int c,int d)
    {
        from = u; to = a; next = b; cap = c; flow = d;
    }
}edge[maxm];
int tol;
int head[maxn];
int gap[maxn],dep[maxn],pre[maxn],cur[maxn];
void init()
{
    tol=0;
    memset(head,-1,sizeof(head));
}

void add_edge(int u,int v,int w,int rw=0)
{ //cout << u << " " << v << " " << w << endl;
    edge[tol].get(u, v,head[u],w,0);head[u]=tol++;
    edge[tol].get(v, u,head[v],rw,0);head[v]=tol++;
}
int sap(int start,int end,int N)
{
    memset(gap,0,sizeof(gap));
    memset(dep,0,sizeof(dep));
    memcpy(cur,head,sizeof(head));
    int u=start;
    pre[u]=-1;
    gap[0]=N;
    int ans=0;
    while(dep[start]<N)
    {
        if(u==end)
        {
            int Min=INF;
            for(int i=pre[u];i!=-1;i=pre[edge[i^1].to])
                if(Min>edge[i].cap-edge[i].flow)
                   Min=edge[i].cap-edge[i].flow;
            for(int i=pre[u];i!=-1;i=pre[edge[i^1].to])
            {
                edge[i].flow+=Min;
                edge[i^1].flow-=Min;
            }
            u = start;
            ans+=Min;
            continue;
        }
        bool flag=false;
        int v;
        for(int i=cur[u];i !=-1;i=edge[i].next)
        {
            v=edge[i].to;
            if(edge[i].cap-edge[i].flow&&dep[v]+1==dep[u])
            {
                flag=true;
                cur[u]=pre[v]=i;
                break;
            }
        }
        if(flag)
        {
            u=v;
            continue;
        }
        int Min=N;
        for(int i=head[u];i!=-1;i=edge[i].next)
            if(edge[i].cap-edge[i].flow&&dep[edge[i].to]<Min)
        {
            Min=dep[edge[i].to];
            cur[u]=i;
        }
        gap[dep[u]]--;
        if(!gap[dep[u]]) return ans;
        dep[u]=Min+1;
        gap[dep[u]]++;
        if(u!=start) u=edge[pre[u]^1].to;
    }
    return ans;
}

int e[511][3];

bool ok (double num) {//总重量为num的情况下能不能完成
    double per = num/x;//每只熊
    init ();
    s = 0, t = n-1, N = n;
    for (int i = 1; i <= m; i++) {
        int u = e[i][0]-1, v = e[i][1]-1, w = e[i][2];
        int cap = floor (1.0*w/per);
        add_edge (u, v, cap);
    }
    int ans = sap (s, t, N);
    return ans >= x;
}

int main () {
    //freopen ("in.txt", "r", stdin);
    scanf ("%d%d%d", &n, &m, &x);
    for (int i = 1; i <= m; i++) {
        scanf ("%d%d%d", &e[i][0], &e[i][1], &e[i][2]);
    }
    double l = 0.0, r = 1e7;
    while (r-l > eps) {
        double mid = (l+r)/2.0;
        if (ok (mid))
            l = mid;
        else
            r = mid;
    }
    printf ("%.10f\n", ok (r) ? r : l);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
const int INF = 1e8;
#define maxn 55
#define maxm 1111
#define eps 1e-8

int n, m, x, N;
int s, t;
struct Edge
{
    int from, to,next,cap,flow;
    void get(int u,int a,int b,int c,int d)
    {
        from = u; to = a; next = b; cap = c; flow = d;
    }
}edge[maxm];
int tol;
int head[maxn];
int gap[maxn],dep[maxn],pre[maxn],cur[maxn];
void init()
{
    tol=0;
    memset(head,-1,sizeof(head));
}

void add_edge(int u,int v,int w,int rw=0)
{ //cout << u << " " << v << " " << w << endl;
    edge[tol].get(u, v,head[u],w,0);head[u]=tol++;
    edge[tol].get(v, u,head[v],rw,0);head[v]=tol++;
}
int sap(int start,int end,int N)
{
    memset(gap,0,sizeof(gap));
    memset(dep,0,sizeof(dep));
    memcpy(cur,head,sizeof(head));
    int u=start;
    pre[u]=-1;
    gap[0]=N;
    int ans=0;
    while(dep[start]<N)
    {
        if(u==end)
        {
            int Min=INF;
            for(int i=pre[u];i!=-1;i=pre[edge[i^1].to])
                if(Min>edge[i].cap-edge[i].flow)
                   Min=edge[i].cap-edge[i].flow;
            for(int i=pre[u];i!=-1;i=pre[edge[i^1].to])
            {
                edge[i].flow+=Min;
                edge[i^1].flow-=Min;
            }
            u = start;
            ans+=Min;
            continue;
        }
        bool flag=false;
        int v;
        for(int i=cur[u];i !=-1;i=edge[i].next)
        {
            v=edge[i].to;
            if(edge[i].cap-edge[i].flow&&dep[v]+1==dep[u])
            {
                flag=true;
                cur[u]=pre[v]=i;
                break;
            }
        }
        if(flag)
        {
            u=v;
            continue;
        }
        int Min=N;
        for(int i=head[u];i!=-1;i=edge[i].next)
            if(edge[i].cap-edge[i].flow&&dep[edge[i].to]<Min)
        {
            Min=dep[edge[i].to];
            cur[u]=i;
        }
        gap[dep[u]]--;
        if(!gap[dep[u]]) return ans;
        dep[u]=Min+1;
        gap[dep[u]]++;
        if(u!=start) u=edge[pre[u]^1].to;
    }
    return ans;
}

int e[511][3];

bool ok (double num) {//总重量为num的情况下能不能完成
    double per = num/x;//每只熊
    init ();
    s = 0, t = n-1, N = n;
    for (int i = 1; i <= m; i++) {
        int u = e[i][0]-1, v = e[i][1]-1, w = e[i][2];
        int cap = floor (1.0*w/per);
        add_edge (u, v, cap);
    }
    int ans = sap (s, t, N);
    return ans >= x;
}

int main () {
    //freopen ("in.txt", "r", stdin);
    scanf ("%d%d%d", &n, &m, &x);
    double Min = INF;
    for (int i = 1; i <= m; i++) {
        scanf ("%d%d%d", &e[i][0], &e[i][1], &e[i][2]);
        Min = min (Min, (double)e[i][2]);
    }
    double l = Min/x, r = 1e6;
    while (r-l > eps) {
        double mid = (l+r)/2.0;
        if (ok (mid))
            l = mid;
        else
            r = mid;
    }
    printf ("%.10f\n", ok (r) ? r : l);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
const int INF = 1e8;
#define maxn 55
#define maxm 1111
#define eps 1e-8

int n, m, x, N;
int s, t;
int tol;
int head[maxn];
int gap[maxn],dep[maxn],pre[maxn],cur[maxn];

struct Edge
{
    int to,next,cap,flow;
}edge[maxm];//注意是maxm
void init()
{
    tol = 0;
    memset(head,-1,sizeof(head));
}
void add_edge(int u,int v,int w,int rw = 0)
{
    edge[tol].to = v; edge[tol].cap = w; edge[tol].flow = 0;
    edge[tol].next = head[u]; head[u] = tol++;
    edge[tol].to = u; edge[tol].cap = rw; edge[tol].flow = 0;
    edge[tol].next = head[v]; head[v] = tol++;
}
int Q[maxn];
void BFS(int start,int end)
{
    memset(dep,-1,sizeof(dep));
    memset(gap,0,sizeof(gap));
    gap[0] = 1;
    int front = 0, rear = 0;
    dep[end] = 0;
    Q[rear++] = end;
    while(front != rear)
    {
        int u = Q[front++];
        for(int i = head[u]; i != -1; i = edge[i].next)
        {
            int v = edge[i].to;
            if(dep[v] != -1)continue;
            Q[rear++] = v;
            dep[v] = dep[u] + 1;
            gap[dep[v]]++;
        }
    }
}
int S[maxn];
int sap(int start,int end,int N)
{
    BFS(start,end);
    memcpy(cur,head,sizeof(head));
    int top = 0;
    int u = start;
    int ans = 0;
    while(dep[start] < N)
    {
        if(u == end)
        {
            int Min = INF;
            int inser;
            for(int i = 0;i < top;i++)
            if(Min > edge[S[i]].cap - edge[S[i]].flow)
            {
                Min = edge[S[i]].cap - edge[S[i]].flow;
                inser = i;
            }
            for(int i = 0;i < top;i++)
            {
                edge[S[i]].flow += Min;
                edge[S[i]^1].flow -= Min;
            }
            ans += Min;
            top = inser;
            u = edge[S[top]^1].to;
            continue;
        }
        bool flag = false;
        int v;
        for(int i = cur[u]; i != -1; i = edge[i].next)
        {
            v = edge[i].to;
            if(edge[i].cap - edge[i].flow && dep[v]+1 == dep[u])
            {
                flag = true;
                cur[u] = i;
                break;
            }
        }
        if(flag)
        {
            S[top++] = cur[u];
            u = v;
            continue;
        }
        int Min = N;
        for(int i = head[u]; i != -1; i = edge[i].next)
        if(edge[i].cap - edge[i].flow && dep[edge[i].to] < Min)
        {
            Min = dep[edge[i].to];
            cur[u] = i;
        }
        gap[dep[u]]--;
        if(!gap[dep[u]])return ans;
        dep[u] = Min + 1;
        gap[dep[u]]++;
        if(u != start)u = edge[S[--top]^1].to;
    }
    return ans;
}

int e[511][3];

bool ok (double num) {//总重量为num的情况下能不能完成
    double per = num/x;//每只熊
    init ();
    s = 0, t = n-1, N = n;
    for (int i = 1; i <= m; i++) {
        int u = e[i][0]-1, v = e[i][1]-1, w = e[i][2];
        int cap = floor (1.0*w/per);
        add_edge (u, v, cap);
    }
    int ans = sap (s, t, N);
    return ans >= x;
}

int main () {
    //freopen ("in.txt", "r", stdin);
    scanf ("%d%d%d", &n, &m, &x);
    double Min = INF;
    for (int i = 1; i <= m; i++) {
        scanf ("%d%d%d", &e[i][0], &e[i][1], &e[i][2]);
        Min = min (Min, (double)e[i][2]);
    }
    double l = Min/x, r = 1e10;
    while (r-l > eps) {
        double mid = (l+r)/2.0;
        if (ok (mid))
            l = mid;
        else
            r = mid;
    }
    printf ("%.10f\n", ok (r) ? r : l);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
const int INF = 1e8;
#define maxn 55
#define maxm 1111
#define eps 1e-8

int n, m, x, N;
int s, t;
struct Edge
{
    int from, to,next,cap,flow;
    void get(int u,int a,int b,int c,int d)
    {
        from = u; to = a; next = b; cap = c; flow = d;
    }
}edge[maxm];
int tol;
int head[maxn];
int gap[maxn],dep[maxn],pre[maxn],cur[maxn];
void init()
{
    tol=0;
    memset(head,-1,sizeof(head));
}

void add_edge(int u,int v,int w,int rw=0)
{ //cout << u << " " << v << " " << w << endl;
    edge[tol].get(u, v,head[u],w,0);head[u]=tol++;
    edge[tol].get(v, u,head[v],rw,0);head[v]=tol++;
}
int sap(int start,int end,int N)
{
    memset(gap,0,sizeof(gap));
    memset(dep,0,sizeof(dep));
    memcpy(cur,head,sizeof(head));
    int u=start;
    pre[u]=-1;
    gap[0]=N;
    int ans=0;
    while(dep[start]<N)
    {
        if(u==end)
        {
            int Min=INF;
            for(int i=pre[u];i!=-1;i=pre[edge[i^1].to])
                if(Min>edge[i].cap-edge[i].flow)
                   Min=edge[i].cap-edge[i].flow;
            for(int i=pre[u];i!=-1;i=pre[edge[i^1].to])
            {
                edge[i].flow+=Min;
                edge[i^1].flow-=Min;
            }
            u = start;
            ans+=Min;
            continue;
        }
        bool flag=false;
        int v;
        for(int i=cur[u];i !=-1;i=edge[i].next)
        {
            v=edge[i].to;
            if(edge[i].cap-edge[i].flow&&dep[v]+1==dep[u])
            {
                flag=true;
                cur[u]=pre[v]=i;
                break;
            }
        }
        if(flag)
        {
            u=v;
            continue;
        }
        int Min=N;
        for(int i=head[u];i!=-1;i=edge[i].next)
            if(edge[i].cap-edge[i].flow&&dep[edge[i].to]<Min)
        {
            Min=dep[edge[i].to];
            cur[u]=i;
        }
        gap[dep[u]]--;
        if(!gap[dep[u]]) return ans;
        dep[u]=Min+1;
        gap[dep[u]]++;
        if(u!=start) u=edge[pre[u]^1].to;
    }
    return ans;
}

int e[511][3];

bool ok (double num) {//总重量为num的情况下能不能完成
    double per = num/x;//每只熊
    init ();
    s = 0, t = n-1, N = n;
    for (int i = 1; i <= m; i++) {
        int u = e[i][0]-1, v = e[i][1]-1, w = e[i][2];
        int cap = floor (1.0*w/per);
        add_edge (u, v, cap);
    }
    int ans = sap (s, t, N);
    return ans >= x;
}

int main () {
    //freopen ("in.txt", "r", stdin);
    scanf ("%d%d%d", &n, &m, &x);
    double Min = INF;
    for (int i = 1; i <= m; i++) {
        scanf ("%d%d%d", &e[i][0], &e[i][1], &e[i][2]);
        Min = min (Min, (double)e[i][2]);
    }
    double l = Min/x, r = 1e7;
    while (r-l > eps) {
        double mid = (l+r)/2.0;
        if (ok (mid))
            l = mid;
        else
            r = mid;
    }
    printf ("%.10f\n", ok (r) ? r : l);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
const int INF = 1e8;
#define maxn 55
#define maxm 1111
#define eps 1e-8

int n, m, x, N;
int s, t;
int tol;
int head[maxn];
int gap[maxn],dep[maxn],pre[maxn],cur[maxn];

struct Edge
{
    int to,next,cap,flow;
}edge[maxm];//注意是maxm
void init()
{
    tol = 0;
    memset(head,-1,sizeof(head));
}
void add_edge(int u,int v,int w,int rw = 0)
{
    edge[tol].to = v; edge[tol].cap = w; edge[tol].flow = 0;
    edge[tol].next = head[u]; head[u] = tol++;
    edge[tol].to = u; edge[tol].cap = rw; edge[tol].flow = 0;
    edge[tol].next = head[v]; head[v] = tol++;
}
int Q[maxn];
void BFS(int start,int end)
{
    memset(dep,-1,sizeof(dep));
    memset(gap,0,sizeof(gap));
    gap[0] = 1;
    int front = 0, rear = 0;
    dep[end] = 0;
    Q[rear++] = end;
    while(front != rear)
    {
        int u = Q[front++];
        for(int i = head[u]; i != -1; i = edge[i].next)
        {
            int v = edge[i].to;
            if(dep[v] != -1)continue;
            Q[rear++] = v;
            dep[v] = dep[u] + 1;
            gap[dep[v]]++;
        }
    }
}
int S[maxn];
int sap(int start,int end,int N)
{
    BFS(start,end);
    memcpy(cur,head,sizeof(head));
    int top = 0;
    int u = start;
    int ans = 0;
    while(dep[start] < N)
    {
        if(u == end)
        {
            int Min = INF;
            int inser;
            for(int i = 0;i < top;i++)
            if(Min > edge[S[i]].cap - edge[S[i]].flow)
            {
                Min = edge[S[i]].cap - edge[S[i]].flow;
                inser = i;
            }
            for(int i = 0;i < top;i++)
            {
                edge[S[i]].flow += Min;
                edge[S[i]^1].flow -= Min;
            }
            ans += Min;
            top = inser;
            u = edge[S[top]^1].to;
            continue;
        }
        bool flag = false;
        int v;
        for(int i = cur[u]; i != -1; i = edge[i].next)
        {
            v = edge[i].to;
            if(edge[i].cap - edge[i].flow && dep[v]+1 == dep[u])
            {
                flag = true;
                cur[u] = i;
                break;
            }
        }
        if(flag)
        {
            S[top++] = cur[u];
            u = v;
            continue;
        }
        int Min = N;
        for(int i = head[u]; i != -1; i = edge[i].next)
        if(edge[i].cap - edge[i].flow && dep[edge[i].to] < Min)
        {
            Min = dep[edge[i].to];
            cur[u] = i;
        }
        gap[dep[u]]--;
        if(!gap[dep[u]])return ans;
        dep[u] = Min + 1;
        gap[dep[u]]++;
        if(u != start)u = edge[S[--top]^1].to;
    }
    return ans;
}

int e[511][3];

bool ok (double num) {//总重量为num的情况下能不能完成
    double per = num/x;//每只熊
    init ();
    s = 0, t = n-1, N = n;
    for (int i = 1; i <= m; i++) {
        int u = e[i][0]-1, v = e[i][1]-1, w = e[i][2];
        int cap = floor (1.0*w/per);
        add_edge (u, v, cap);
    }
    int ans = sap (s, t, N);
    return ans >= x;
}

int main () {
    //freopen ("in.txt", "r", stdin);
    scanf ("%d%d%d", &n, &m, &x);
    double Min = INF;
    for (int i = 1; i <= m; i++) {
        scanf ("%d%d%d", &e[i][0], &e[i][1], &e[i][2]);
        Min = min (Min, (double)e[i][2]);
    }
    double l = Min/x, r = 1e7;
    while (r-l > eps) {
        double mid = (l+r)/2.0;
        if (ok (mid))
            l = mid;
        else
            r = mid;
    }
    printf ("%.10f\n", ok (r) ? r : l);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
const int INF = 1e8;
#define maxn 55
#define maxm 1111
#define eps 1e-8

int n, m, x, N;
int s, t;
int tol;
int head[maxn];
int gap[maxn],dep[maxn],pre[maxn],cur[maxn];

struct Edge
{
    int to,next,cap,flow;
}edge[maxm];//注意是maxm
void init()
{
    tol = 0;
    memset(head,-1,sizeof(head));
}
void add_edge(int u,int v,int w,int rw = 0)
{
    edge[tol].to = v; edge[tol].cap = w; edge[tol].flow = 0;
    edge[tol].next = head[u]; head[u] = tol++;
    edge[tol].to = u; edge[tol].cap = rw; edge[tol].flow = 0;
    edge[tol].next = head[v]; head[v] = tol++;
}
int Q[maxn];
void BFS(int start,int end)
{
    memset(dep,-1,sizeof(dep));
    memset(gap,0,sizeof(gap));
    gap[0] = 1;
    int front = 0, rear = 0;
    dep[end] = 0;
    Q[rear++] = end;
    while(front != rear)
    {
        int u = Q[front++];
        for(int i = head[u]; i != -1; i = edge[i].next)
        {
            int v = edge[i].to;
            if(dep[v] != -1)continue;
            Q[rear++] = v;
            dep[v] = dep[u] + 1;
            gap[dep[v]]++;
        }
    }
}
int S[maxn];
int sap(int start,int end,int N)
{
    BFS(start,end);
    memcpy(cur,head,sizeof(head));
    int top = 0;
    int u = start;
    int ans = 0;
    while(dep[start] < N)
    {
        if(u == end)
        {
            int Min = INF;
            int inser;
            for(int i = 0;i < top;i++)
            if(Min > edge[S[i]].cap - edge[S[i]].flow)
            {
                Min = edge[S[i]].cap - edge[S[i]].flow;
                inser = i;
            }
            for(int i = 0;i < top;i++)
            {
                edge[S[i]].flow += Min;
                edge[S[i]^1].flow -= Min;
            }
            ans += Min;
            top = inser;
            u = edge[S[top]^1].to;
            continue;
        }
        bool flag = false;
        int v;
        for(int i = cur[u]; i != -1; i = edge[i].next)
        {
            v = edge[i].to;
            if(edge[i].cap - edge[i].flow && dep[v]+1 == dep[u])
            {
                flag = true;
                cur[u] = i;
                break;
            }
        }
        if(flag)
        {
            S[top++] = cur[u];
            u = v;
            continue;
        }
        int Min = N;
        for(int i = head[u]; i != -1; i = edge[i].next)
        if(edge[i].cap - edge[i].flow && dep[edge[i].to] < Min)
        {
            Min = dep[edge[i].to];
            cur[u] = i;
        }
        gap[dep[u]]--;
        if(!gap[dep[u]])return ans;
        dep[u] = Min + 1;
        gap[dep[u]]++;
        if(u != start)u = edge[S[--top]^1].to;
    }
    return ans;
}

int e[511][3];

bool ok (double num) {//总重量为num的情况下能不能完成
    double per = num/x;//每只熊
    init ();
    s = 0, t = n-1, N = n;
    for (int i = 1; i <= m; i++) {
        int u = e[i][0]-1, v = e[i][1]-1, w = e[i][2];
        int cap = floor (1.0*w/per);
        add_edge (u, v, cap);
    }
    int ans = sap (s, t, N);
    return ans >= x;
}

int main () {
    //freopen ("in.txt", "r", stdin);
    scanf ("%d%d%d", &n, &m, &x);
    double Min = INF;
    for (int i = 1; i <= m; i++) {
        scanf ("%d%d%d", &e[i][0], &e[i][1], &e[i][2]);
        Min = min (Min, (double)e[i][2]);
    }
    double l = Min/x, r = 1e8;
    while (r-l > eps) {
        double mid = (l+r)/2.0;
        if (ok (mid))
            l = mid;
        else
            r = mid;
    }
    printf ("%.10f\n", ok (r) ? r : l);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
const long long INF = 1e8;
#define maxn 55
#define maxm 1111
#define eps 1e-9

long long n, m, x, N;
long long s, t;
struct Edge
{
    long long from, to,next,cap,flow;
    void get(long long u,long long a,long long b,long long c,long long d)
    {
        from = u; to = a; next = b; cap = c; flow = d;
    }
}edge[maxm];
long long tol;
long long head[maxn];
long long gap[maxn],dep[maxn],pre[maxn],cur[maxn];
void init()
{
    tol=0;
    memset(head,-1,sizeof(head));
}

void add_edge(long long u,long long v,long long w,long long rw=0)
{ //cout << u << " " << v << " " << w << endl;
    edge[tol].get(u, v,head[u],w,0);head[u]=tol++;
    edge[tol].get(v, u,head[v],rw,0);head[v]=tol++;
}
long long sap(long long start,long long end,long long N)
{
    memset(gap,0,sizeof(gap));
    memset(dep,0,sizeof(dep));
    memcpy(cur,head,sizeof(head));
    long long u=start;
    pre[u]=-1;
    gap[0]=N;
    long long ans=0;
    while(dep[start]<N)
    {
        if(u==end)
        {
            long long Min=INF;
            for(long long i=pre[u];i!=-1;i=pre[edge[i^1].to])
                if(Min>edge[i].cap-edge[i].flow)
                   Min=edge[i].cap-edge[i].flow;
            for(long long i=pre[u];i!=-1;i=pre[edge[i^1].to])
            {
                edge[i].flow+=Min;
                edge[i^1].flow-=Min;
            }
            u = start;
            ans+=Min;
            continue;
        }
        bool flag=false;
        long long v;
        for(long long i=cur[u];i !=-1;i=edge[i].next)
        {
            v=edge[i].to;
            if(edge[i].cap-edge[i].flow&&dep[v]+1==dep[u])
            {
                flag=true;
                cur[u]=pre[v]=i;
                break;
            }
        }
        if(flag)
        {
            u=v;
            continue;
        }
        long long Min=N;
        for(long long i=head[u];i!=-1;i=edge[i].next)
            if(edge[i].cap-edge[i].flow&&dep[edge[i].to]<Min)
        {
            Min=dep[edge[i].to];
            cur[u]=i;
        }
        gap[dep[u]]--;
        if(!gap[dep[u]]) return ans;
        dep[u]=Min+1;
        gap[dep[u]]++;
        if(u!=start) u=edge[pre[u]^1].to;
    }
    return ans;
}

long long e[511][3];

bool ok (double num) {//总重量为num的情况下能不能完成
    double per = num/x;//每只熊
    init ();
    s = 0, t = n-1, N = n;
    for (long long i = 1; i <= m; i++) {
        long long u = e[i][0]-1, v = e[i][1]-1, w = e[i][2];
        long long cap = floor (1.0*w/per);
        add_edge (u, v, cap);
    }
    long long ans = sap (s, t, N);
    return ans >= x;
}

int main () {
    //freopen ("in.txt", "r", stdin);
    scanf ("%d%d%d", &n, &m, &x);
    for (long long i = 1; i <= m; i++) {
        scanf ("%d%d%d", &e[i][0], &e[i][1], &e[i][2]);
    }
    double l = 0.0, r = 1e7;
    int k = 200;
    while (k--) {
        double mid = (l+r)/2.0;
        if (ok (mid))
            l = mid;
        else
            r = mid;
    }
    printf ("%.10f\n", ok (r) ? r : l);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
const int INF = 1e8;
#define maxn 55
#define maxm 1111
#define eps 1e-9

int n, m, x, N;
int s, t;
struct Edge
{
    int from, to,next,cap,flow;
    void get(int u,int a,int b,int c,int d)
    {
        from = u; to = a; next = b; cap = c; flow = d;
    }
}edge[maxm];
int tol;
int head[maxn];
int gap[maxn],dep[maxn],pre[maxn],cur[maxn];
void init()
{
    tol=0;
    memset(head,-1,sizeof(head));
}

void add_edge(int u,int v,int w,int rw=0)
{ //cout << u << " " << v << " " << w << endl;
    edge[tol].get(u, v,head[u],w,0);head[u]=tol++;
    edge[tol].get(v, u,head[v],rw,0);head[v]=tol++;
}
int sap(int start,int end,int N)
{
    memset(gap,0,sizeof(gap));
    memset(dep,0,sizeof(dep));
    memcpy(cur,head,sizeof(head));
    int u=start;
    pre[u]=-1;
    gap[0]=N;
    int ans=0;
    while(dep[start]<N)
    {
        if(u==end)
        {
            int Min=INF;
            for(int i=pre[u];i!=-1;i=pre[edge[i^1].to])
                if(Min>edge[i].cap-edge[i].flow)
                   Min=edge[i].cap-edge[i].flow;
            for(int i=pre[u];i!=-1;i=pre[edge[i^1].to])
            {
                edge[i].flow+=Min;
                edge[i^1].flow-=Min;
            }
            u = start;
            ans+=Min;
            continue;
        }
        bool flag=false;
        int v;
        for(int i=cur[u];i !=-1;i=edge[i].next)
        {
            v=edge[i].to;
            if(edge[i].cap-edge[i].flow&&dep[v]+1==dep[u])
            {
                flag=true;
                cur[u]=pre[v]=i;
                break;
            }
        }
        if(flag)
        {
            u=v;
            continue;
        }
        int Min=N;
        for(int i=head[u];i!=-1;i=edge[i].next)
            if(edge[i].cap-edge[i].flow&&dep[edge[i].to]<Min)
        {
            Min=dep[edge[i].to];
            cur[u]=i;
        }
        gap[dep[u]]--;
        if(!gap[dep[u]]) return ans;
        dep[u]=Min+1;
        gap[dep[u]]++;
        if(u!=start) u=edge[pre[u]^1].to;
    }
    return ans;
}

int e[511][3];

bool ok (double num) {//总重量为num的情况下能不能完成
    double per = num/x;//每只熊
    init ();
    s = 0, t = n-1, N = n;
    for (int i = 1; i <= m; i++) {
        int u = e[i][0]-1, v = e[i][1]-1, w = e[i][2];
        int cap = floor (1.0*w/per);
        add_edge (u, v, cap);
    }
    int ans = sap (s, t, N);
    return ans >= x;
}

int main () {
    //freopen ("in.txt", "r", stdin);
    scanf ("%d%d%d", &n, &m, &x);
    double Min = INF;
    for (int i = 1; i <= m; i++) {
        scanf ("%d%d%d", &e[i][0], &e[i][1], &e[i][2]);
        Min = min (Min, (double)e[i][2]);
    }
    double l = Min/x, r = 1e7;
    while (r-l > eps) {
        double mid = (l+r)/2.0;
        if (ok (mid))
            l = mid;
        else
            r = mid;
    }
    printf ("%.10f\n", ok (r) ? r : l);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
const int INF = 1e8;
#define maxn 3333
#define maxm 411111
#define eps 1e-7

int n, m, x, N;
int s, t;
struct Edge
{
    int from, to,next,cap,flow;
    void get(int u,int a,int b,int c,int d)
    {
        from = u; to = a; next = b; cap = c; flow = d;
    }
}edge[maxm];
int tol;
int head[maxn];
int gap[maxn],dep[maxn],pre[maxn],cur[maxn];
void init()
{
    tol=0;
    memset(head,-1,sizeof(head));
}

void add_edge(int u,int v,int w,int rw=0)
{ //cout << u << " " << v << " " << w << endl;
    edge[tol].get(u, v,head[u],w,0);head[u]=tol++;
    edge[tol].get(v, u,head[v],rw,0);head[v]=tol++;
}
int sap(int start,int end,int N)
{
    memset(gap,0,sizeof(gap));
    memset(dep,0,sizeof(dep));
    memcpy(cur,head,sizeof(head));
    int u=start;
    pre[u]=-1;
    gap[0]=N;
    int ans=0;
    while(dep[start]<N)
    {
        if(u==end)
        {
            int Min=INF;
            for(int i=pre[u];i!=-1;i=pre[edge[i^1].to])
                if(Min>edge[i].cap-edge[i].flow)
                   Min=edge[i].cap-edge[i].flow;
            for(int i=pre[u];i!=-1;i=pre[edge[i^1].to])
            {
                edge[i].flow+=Min;
                edge[i^1].flow-=Min;
            }
            u = start;
            ans+=Min;
            continue;
        }
        bool flag=false;
        int v;
        for(int i=cur[u];i !=-1;i=edge[i].next)
        {
            v=edge[i].to;
            if(edge[i].cap-edge[i].flow&&dep[v]+1==dep[u])
            {
                flag=true;
                cur[u]=pre[v]=i;
                break;
            }
        }
        if(flag)
        {
            u=v;
            continue;
        }
        int Min=N;
        for(int i=head[u];i!=-1;i=edge[i].next)
            if(edge[i].cap-edge[i].flow&&dep[edge[i].to]<Min)
        {
            Min=dep[edge[i].to];
            cur[u]=i;
        }
        gap[dep[u]]--;
        if(!gap[dep[u]]) return ans;
        dep[u]=Min+1;
        gap[dep[u]]++;
        if(u!=start) u=edge[pre[u]^1].to;
    }
    return ans;
}

int e[511][3];

bool ok (double num) {//总重量为num的情况下能不能完成
    double per = num/x;//每只熊
    init ();
    s = 0, t = n-1, N = n;
    for (int i = 1; i <= m; i++) {
        int u = e[i][0]-1, v = e[i][1]-1, w = e[i][2];
        int cap = floor (1.0*w/per);
        add_edge (u, v, cap);
    }
    int ans = sap (s, t, N);
    return ans >= x;
}

int main () {
    //freopen ("in.txt", "r", stdin);
    scanf ("%d%d%d", &n, &m, &x);
    for (int i = 1; i <= m; i++) {
        scanf ("%d%d%d", &e[i][0], &e[i][1], &e[i][2]);
    }
    double l = 0.0, r = 1e6;
    while (r-l > eps) {
        double mid = (l+r)/2.0;
        if (ok (mid))
            l = mid;
        else
            r = mid;
    }
    printf ("%.10f\n", ok (r) ? r : l);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
const int INF = 1e8;
#define maxn 55
#define maxm 1111
#define eps 1e-7

int n, m, x, N;
int s, t;
struct Edge
{
    int from, to,next,cap,flow;
    void get(int u,int a,int b,int c,int d)
    {
        from = u; to = a; next = b; cap = c; flow = d;
    }
}edge[maxm];
int tol;
int head[maxn];
int gap[maxn],dep[maxn],pre[maxn],cur[maxn];
void init()
{
    tol=0;
    memset(head,-1,sizeof(head));
}

void add_edge(int u,int v,int w,int rw=0)
{ //cout << u << " " << v << " " << w << endl;
    edge[tol].get(u, v,head[u],w,0);head[u]=tol++;
    edge[tol].get(v, u,head[v],rw,0);head[v]=tol++;
}
int sap(int start,int end,int N)
{
    memset(gap,0,sizeof(gap));
    memset(dep,0,sizeof(dep));
    memcpy(cur,head,sizeof(head));
    int u=start;
    pre[u]=-1;
    gap[0]=N;
    int ans=0;
    while(dep[start]<N)
    {
        if(u==end)
        {
            int Min=INF;
            for(int i=pre[u];i!=-1;i=pre[edge[i^1].to])
                if(Min>edge[i].cap-edge[i].flow)
                   Min=edge[i].cap-edge[i].flow;
            for(int i=pre[u];i!=-1;i=pre[edge[i^1].to])
            {
                edge[i].flow+=Min;
                edge[i^1].flow-=Min;
            }
            u = start;
            ans+=Min;
            continue;
        }
        bool flag=false;
        int v;
        for(int i=cur[u];i !=-1;i=edge[i].next)
        {
            v=edge[i].to;
            if(edge[i].cap-edge[i].flow&&dep[v]+1==dep[u])
            {
                flag=true;
                cur[u]=pre[v]=i;
                break;
            }
        }
        if(flag)
        {
            u=v;
            continue;
        }
        int Min=N;
        for(int i=head[u];i!=-1;i=edge[i].next)
            if(edge[i].cap-edge[i].flow&&dep[edge[i].to]<Min)
        {
            Min=dep[edge[i].to];
            cur[u]=i;
        }
        gap[dep[u]]--;
        if(!gap[dep[u]]) return ans;
        dep[u]=Min+1;
        gap[dep[u]]++;
        if(u!=start) u=edge[pre[u]^1].to;
    }
    return ans;
}

int e[511][3];

bool ok (double num) {//总重量为num的情况下能不能完成
    double per = num/x;//每只熊
    init ();
    s = 0, t = n-1, N = n;
    for (int i = 1; i <= m; i++) {
        int u = e[i][0]-1, v = e[i][1]-1, w = e[i][2];
        int cap = floor (1.0*w/per);
        add_edge (u, v, cap);
    }
    int ans = sap (s, t, N);
    return ans >= x;
}

int main () {
    //freopen ("in.txt", "r", stdin);
    scanf ("%d%d%d", &n, &m, &x);
    for (int i = 1; i <= m; i++) {
        scanf ("%d%d%d", &e[i][0], &e[i][1], &e[i][2]);
    }
    double l = 0.0, r = 1e6;
    while (r-l > eps) {
        double mid = (l+r)/2.0;
        if (ok (mid))
            l = mid;
        else
            r = mid;
    }
    printf ("%.10f\n", ok (r) ? r : l);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
const int INF = 1e8;
#define maxn 55
#define maxm 1111
#define eps 1e-8

int n, m, x, N;
int s, t;
int tol;
int head[maxn];
int gap[maxn],dep[maxn],pre[maxn],cur[maxn];

struct Edge
{
    int to,next,cap,flow;
}edge[maxm];//注意是maxm
void init()
{
    tol = 0;
    memset(head,-1,sizeof(head));
}
void add_edge(int u,int v,int w,int rw = 0)
{
    edge[tol].to = v; edge[tol].cap = w; edge[tol].flow = 0;
    edge[tol].next = head[u]; head[u] = tol++;
    edge[tol].to = u; edge[tol].cap = rw; edge[tol].flow = 0;
    edge[tol].next = head[v]; head[v] = tol++;
}
int Q[maxn];
void BFS(int start,int end)
{
    memset(dep,-1,sizeof(dep));
    memset(gap,0,sizeof(gap));
    gap[0] = 1;
    int front = 0, rear = 0;
    dep[end] = 0;
    Q[rear++] = end;
    while(front != rear)
    {
        int u = Q[front++];
        for(int i = head[u]; i != -1; i = edge[i].next)
        {
            int v = edge[i].to;
            if(dep[v] != -1)continue;
            Q[rear++] = v;
            dep[v] = dep[u] + 1;
            gap[dep[v]]++;
        }
    }
}
int S[maxn];
int sap(int start,int end,int N)
{
    BFS(start,end);
    memcpy(cur,head,sizeof(head));
    int top = 0;
    int u = start;
    int ans = 0;
    while(dep[start] < N)
    {
        if(u == end)
        {
            int Min = INF;
            int inser;
            for(int i = 0;i < top;i++)
            if(Min > edge[S[i]].cap - edge[S[i]].flow)
            {
                Min = edge[S[i]].cap - edge[S[i]].flow;
                inser = i;
            }
            for(int i = 0;i < top;i++)
            {
                edge[S[i]].flow += Min;
                edge[S[i]^1].flow -= Min;
            }
            ans += Min;
            top = inser;
            u = edge[S[top]^1].to;
            continue;
        }
        bool flag = false;
        int v;
        for(int i = cur[u]; i != -1; i = edge[i].next)
        {
            v = edge[i].to;
            if(edge[i].cap - edge[i].flow && dep[v]+1 == dep[u])
            {
                flag = true;
                cur[u] = i;
                break;
            }
        }
        if(flag)
        {
            S[top++] = cur[u];
            u = v;
            continue;
        }
        int Min = N;
        for(int i = head[u]; i != -1; i = edge[i].next)
        if(edge[i].cap - edge[i].flow && dep[edge[i].to] < Min)
        {
            Min = dep[edge[i].to];
            cur[u] = i;
        }
        gap[dep[u]]--;
        if(!gap[dep[u]])return ans;
        dep[u] = Min + 1;
        gap[dep[u]]++;
        if(u != start)u = edge[S[--top]^1].to;
    }
    return ans;
}

int e[511][3];

bool ok (double num) {//总重量为num的情况下能不能完成
    double per = num/x;//每只熊
    init ();
    s = 0, t = n-1, N = n;
    for (int i = 1; i <= m; i++) {
        int u = e[i][0]-1, v = e[i][1]-1, w = e[i][2];
        int cap = floor (1.0*w/per);
        add_edge (u, v, cap);
    }
    int ans = sap (s, t, N);
    return ans >= x;
}

int main () {
    //freopen ("in.txt", "r", stdin);
    scanf ("%d%d%d", &n, &m, &x);
    double Min = INF;
    for (int i = 1; i <= m; i++) {
        scanf ("%d%d%d", &e[i][0], &e[i][1], &e[i][2]);
        Min = min (Min, (double)e[i][2]);
    }
    double l = Min/x, r = 1e13;
    while (r-l > eps) {
        double mid = (l+r)/2.0;
        if (ok (mid))
            l = mid;
        else
            r = mid;
    }
    printf ("%.10f\n", ok (r) ? r : l);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
const int INF = 1e8;
#define maxn 55
#define maxm 1111
#define eps 1e-9

int n, m, x, N;
int s, t;
int tol;
int head[maxn];
int gap[maxn],dep[maxn],pre[maxn],cur[maxn];

struct Edge
{
    int to,next,cap,flow;
}edge[maxm];//注意是maxm
void init()
{
    tol = 0;
    memset(head,-1,sizeof(head));
}
void add_edge(int u,int v,int w,int rw = 0)
{
    edge[tol].to = v; edge[tol].cap = w; edge[tol].flow = 0;
    edge[tol].next = head[u]; head[u] = tol++;
    edge[tol].to = u; edge[tol].cap = rw; edge[tol].flow = 0;
    edge[tol].next = head[v]; head[v] = tol++;
}
int Q[maxn];
void BFS(int start,int end)
{
    memset(dep,-1,sizeof(dep));
    memset(gap,0,sizeof(gap));
    gap[0] = 1;
    int front = 0, rear = 0;
    dep[end] = 0;
    Q[rear++] = end;
    while(front != rear)
    {
        int u = Q[front++];
        for(int i = head[u]; i != -1; i = edge[i].next)
        {
            int v = edge[i].to;
            if(dep[v] != -1)continue;
            Q[rear++] = v;
            dep[v] = dep[u] + 1;
            gap[dep[v]]++;
        }
    }
}
int S[maxn];
int sap(int start,int end,int N)
{
    BFS(start,end);
    memcpy(cur,head,sizeof(head));
    int top = 0;
    int u = start;
    int ans = 0;
    while(dep[start] < N)
    {
        if(u == end)
        {
            int Min = INF;
            int inser;
            for(int i = 0;i < top;i++)
            if(Min > edge[S[i]].cap - edge[S[i]].flow)
            {
                Min = edge[S[i]].cap - edge[S[i]].flow;
                inser = i;
            }
            for(int i = 0;i < top;i++)
            {
                edge[S[i]].flow += Min;
                edge[S[i]^1].flow -= Min;
            }
            ans += Min;
            top = inser;
            u = edge[S[top]^1].to;
            continue;
        }
        bool flag = false;
        int v;
        for(int i = cur[u]; i != -1; i = edge[i].next)
        {
            v = edge[i].to;
            if(edge[i].cap - edge[i].flow && dep[v]+1 == dep[u])
            {
                flag = true;
                cur[u] = i;
                break;
            }
        }
        if(flag)
        {
            S[top++] = cur[u];
            u = v;
            continue;
        }
        int Min = N;
        for(int i = head[u]; i != -1; i = edge[i].next)
        if(edge[i].cap - edge[i].flow && dep[edge[i].to] < Min)
        {
            Min = dep[edge[i].to];
            cur[u] = i;
        }
        gap[dep[u]]--;
        if(!gap[dep[u]])return ans;
        dep[u] = Min + 1;
        gap[dep[u]]++;
        if(u != start)u = edge[S[--top]^1].to;
    }
    return ans;
}

int e[511][3];

bool ok (double num) {//总重量为num的情况下能不能完成
    double per = num/x;//每只熊
    init ();
    s = 0, t = n-1, N = n;
    for (int i = 1; i <= m; i++) {
        int u = e[i][0]-1, v = e[i][1]-1, w = e[i][2];
        int cap = floor (1.0*w/per);
        add_edge (u, v, cap);
    }
    int ans = sap (s, t, N);
    return ans >= x;
}

int main () {
    //freopen ("in.txt", "r", stdin);
    scanf ("%d%d%d", &n, &m, &x);
    double Min = INF;
    for (int i = 1; i <= m; i++) {
        scanf ("%d%d%d", &e[i][0], &e[i][1], &e[i][2]);
        Min = min (Min, (double)e[i][2]);
    }
    double l = Min/x, r = 1e7;
    while (r-l > eps) {
        double mid = (l+r)/2.0;
        if (ok (mid))
            l = mid;
        else
            r = mid;
    }
    printf ("%.10f\n", ok (r) ? r : l);
    return 0;
}


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
const long long INF = 1e8;
#define maxn 55
#define maxm 1111
#define eps 1e-10

long long n, m, x, N;
long long s, t;
struct Edge
{
    long long from, to,next,cap,flow;
    void get(long long u,long long a,long long b,long long c,long long d)
    {
        from = u; to = a; next = b; cap = c; flow = d;
    }
}edge[maxm];
long long tol;
long long head[maxn];
long long gap[maxn],dep[maxn],pre[maxn],cur[maxn];
void init()
{
    tol=0;
    memset(head,-1,sizeof(head));
}

void add_edge(long long u,long long v,long long w,long long rw=0)
{ //cout << u << " " << v << " " << w << endl;
    edge[tol].get(u, v,head[u],w,0);head[u]=tol++;
    edge[tol].get(v, u,head[v],rw,0);head[v]=tol++;
}
long long sap(long long start,long long end,long long N)
{
    memset(gap,0,sizeof(gap));
    memset(dep,0,sizeof(dep));
    memcpy(cur,head,sizeof(head));
    long long u=start;
    pre[u]=-1;
    gap[0]=N;
    long long ans=0;
    while(dep[start]<N)
    {
        if(u==end)
        {
            long long Min=INF;
            for(long long i=pre[u];i!=-1;i=pre[edge[i^1].to])
                if(Min>edge[i].cap-edge[i].flow)
                   Min=edge[i].cap-edge[i].flow;
            for(long long i=pre[u];i!=-1;i=pre[edge[i^1].to])
            {
                edge[i].flow+=Min;
                edge[i^1].flow-=Min;
            }
            u = start;
            ans+=Min;
            continue;
        }
        bool flag=false;
        long long v;
        for(long long i=cur[u];i !=-1;i=edge[i].next)
        {
            v=edge[i].to;
            if(edge[i].cap-edge[i].flow&&dep[v]+1==dep[u])
            {
                flag=true;
                cur[u]=pre[v]=i;
                break;
            }
        }
        if(flag)
        {
            u=v;
            continue;
        }
        long long Min=N;
        for(long long i=head[u];i!=-1;i=edge[i].next)
            if(edge[i].cap-edge[i].flow&&dep[edge[i].to]<Min)
        {
            Min=dep[edge[i].to];
            cur[u]=i;
        }
        gap[dep[u]]--;
        if(!gap[dep[u]]) return ans;
        dep[u]=Min+1;
        gap[dep[u]]++;
        if(u!=start) u=edge[pre[u]^1].to;
    }
    return ans;
}

long long e[511][3];

bool ok (double num) {//总重量为num的情况下能不能完成
    double per = num/x;//每只熊
    init ();
    s = 0, t = n-1, N = n;
    for (long long i = 1; i <= m; i++) {
        long long u = e[i][0]-1, v = e[i][1]-1, w = e[i][2];
        long long cap = floor (1.0*w/per);
        add_edge (u, v, cap);
    }
    long long ans = sap (s, t, N);
    return ans >= x;
}

int main () {
    //freopen ("in.txt", "r", stdin);
    scanf ("%lld%lld%lld", &n, &m, &x);
    for (long long i = 1; i <= m; i++) {
        scanf ("%lld%lld%lld", &e[i][0], &e[i][1], &e[i][2]);
    }
    double l = 0.0, r = 1e12;
    int k = 200;
    while (k--) {
        double mid = (l+r)/2.0;
        if (ok (mid))
            l = mid;
        else
            r = mid;
    }
    printf ("%.10f\n", ok (r) ? r : l);
    return 0;
}


//by tzupengwang™
#include<bits/stdc++.h>
using namespace std;

#define FO(it,c) for (__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
typedef long long ll;
typedef pair<int,int> ii;
typedef long double ld ;

int n , m , x ;
vector< ii > v[ 55 ] ;

void init() {
  scanf( "%d%d%d" , &n , &m , &x ) ;
  for ( int i = 0 ; i < m ; i ++ ) {
    int a , b , c ;
    scanf( "%d%d%d" , &a , &b , &c ) ;
    v[ a ].push_back( ii( b , c ) ) ;
  }
}

#define N 5010
#define M 60010
#define inf 1ll<<62
ll to[ M ] , nxt[ M ] , head[ M ];
ll cnt , ceng[ M ] , que[ M ] , w[ M ];
ll start , tend;
void add( ll a , ll b , ll flow ){
  to[ cnt ] = b , nxt[ cnt ] = head[ a ] , w[ cnt ] = flow , head[ a ] = cnt ++;
  to[ cnt ] = a , nxt[ cnt ] = head[ b ] , w[ cnt ] = flow , head[ b ] = cnt ++;
}
bool bfs(){
  memset( ceng , -1 , sizeof(ceng) );
  ll h = 1 , t = 2;
  ceng[ start ] = 0;
  que[ 1 ] = start;
  while( h < t ){
    ll sta = que[ h ++ ];
    for( ll i = head[ sta ] ; ~i ; i = nxt[ i ] )
      if( w[ i ] > 0 && ceng[ to[ i ] ] < 0 ){
        ceng[ to[ i ] ] = ceng[ sta ] + 1;
        que[ t ++ ] = to[ i ];
      }
  }
  return ceng[ tend ] != -1;
}
ll find( ll x , ll low ){
  ll tmp = 0 , result = 0;
  if( x == tend ) return low;
  for( ll i = head[ x ] ; ~i && result < low ; i = nxt[ i ] )
    if( w[ i ] > 0 && ceng[ to[ i ] ] == ceng[ x ] + 1 ){
      tmp = find( to[ i ] , min( w[ i ] , low - result ) );
      w[ i ] -= tmp;
      w[ i^1 ] += tmp;
      result += tmp;
    }
  if( !result ) ceng[ x ] = -1;
  return result;
}
ll dinic(){
  ll ans = 0 , tmp;
  while( bfs() ) ans += find( start , inf );
  return ans;
}

bool ok( ld nw ) {
  memset(head,-1,sizeof head);
  for ( int i = 1 ; i <= n ; i ++ ) {
    for ( ii k : v[ i ] ) {
      ll bd = (ll)floorl( ((ld)k.second) / nw ) ;
      add( i , k.first , bd );
    }
  }
  tend = n ,start = 1;
  ll ans = dinic() ;
  if ( ans >= x ) return true ;
  else return false ;
}

void process() {
  ld l = 0 , r = 1000000 ;
  for ( int ct = 0 ; ct < 100 ; ct ++ ) {
    ld md = ( l + r ) / 2 ;
    if ( ok( md ) ) l = md ;
    else r = md ;
  }
  printf( "%.20f\n" , (double)( l * (ld)x )) ;
}

int main() {
  init() ;
  process() ;
  return 0 ;
}