{"trustable":false,"sections":[{"title":"","value":{"format":"MD","content":"现在有M个池塘,从1到M开始编号,1的地势最高,M的地势最低,所以水总是从1号池塘经过其它流到M号池塘,现在有N条水渠,给出这N条水渠所连接的池塘和所能流过的最大流速,现在想知道从1号池塘到M号池塘能达到的最大流速,不然放水的速度太大水溢出就淹没土地了。"}},{"title":"Input","value":{"format":"MD","content":"输入包括多组数据。 对于每组数据,第一行包含两个空格分隔的整数,N(0 \u003c\u003d N \u003c\u003d 200)和M(2 \u003c\u003d M \u003c\u003d 200)。 N是挖的沟渠数量。 M是那些沟渠的交叉点。 以下N行中的每一行包含三个整数,Si,Ei和Ci。 Si和Ei(1 \u003c\u003d Si,Ei \u003c\u003d M)表示该沟渠让水从Si号池塘流到Ei号池塘。 Ci(0 \u003c\u003d Ci \u003c\u003d 10,000,000)是水流过沟渠的最大速率。"}},{"title":"Output","value":{"format":"MD","content":"每组输出一个整数表示最大流速"}},{"title":"Sample Input","value":{"format":"MD","content":"```text\n2 3\n1 2 10\n2 3 20\n5 4\n1 2 40\n1 4 20\n2 4 20\n2 3 30\n3 4 10\n```"}},{"title":"Sample Output","value":{"format":"MD","content":"10\n50"}}]}