fn flow(input: &Input, start: usize, end: usize) -> usize
Simplified approach based on Edmonds–Karp algorithm.