more macros and new dinic implementation for maxflow problem