100 #loj117. 有源汇有上下界最小流

有源汇有上下界最小流

[AdditionalFile117.zip](file://AdditionalFile117.zip?type=additional_file)

【题意】

nn 个点,mm 条边,每条边 e 有一个流量下界 lower(e)\text{lower}(e) 和流量上界 upper(e)\text{upper}(e),给定源点 ss 与汇点 tt,求源点到汇点的最小流。

【输入格式】

第一行两个正整数 nmstn、m、s、t

之后的 mm 行,每行四个整数 st、lower、uppers、t、\text{lower}、\text{upper}

【输出格式】

如果无解,输出一行 please go home to sleep。

否则输出最小流。

7 12 6 7
6 1 0 2147483647
1 7 0 2147483647
6 2 0 2147483647
2 7 0 2147483647
6 3 0 2147483647
3 7 0 2147483647
6 4 0 2147483647
4 7 0 2147483647
6 5 0 2147483647
5 7 0 2147483647
5 1 1 2147483647
3 4 1 2147483647
2

【数据范围与提示】

$2 \leq n \leq 50003 , 1\leq m \leq 125003, 1\le s,t,u,v\le n, s\neq t, u\neq v, 0\le \text{lower}\le \text{upper}\le 2^{31}-1$,保证无重边