C program to find minimum average latency of pipelined process