Woka!
The formula is Q = (3.142/4)D^2*V
Where Q is the required flow rate in cu.m/sec, D is pipe inner diameter in meters and V is the velocity of fluid in meters/second. Readjust the equation and you will get the size of the pipe. (There obviously is a minimum diameter than this value) You have to fix the velocity based on the losses in the piping system.
Regards,
Truth: Even the hardest of the problems will have atleast one simple solution. Mine may not be one.