solved for odd number of processes