You can't do that, as all having different lengths. For equaly vector sie you can get the undex position and find the corresponding vector elements from a,b and y. To compare the corresponding array elements, arrays sizes must be same.
I suspect, there may be issue within loop. Look for the solution, how to generate the same length size P, so that you can find the respective array elements from a,b and y, those index values generate the max P.