int dinicDfs(int[] ptr, int[] dist, int dest, int u, int f) {
			if (u == dest)
				return f;
			for (; ptr[u] < ady[u].size(); ++ptr[u]) {
				Edge e = ady[u].get(ptr[u]);
				if (dist[e.t] == dist[u] + 1 && e.f < e.cap) {
					int df = dinicDfs(ptr, dist, dest, e.t,
							Math.min(f, e.cap - e.f));
					if (df > 0) {
						e.f += df;
						ady[e.t].get(e.rev).f -= df;
						return df;
					}
				}
			}
			return 0;
		}