Is it standard maxflow problem? May be it is 4-types of products flow?
AC without times using. LP problem for 4-component flow with help of simplex method(my smpmeth is above struct{__int64 intpart;__int64 num;__int64 denum;char sign;};) By the way, very good question: why maxflow algo doesn't work.