The function accepts the coordinates of truck A(Ax, Ay) int Distance
You are given a function,int Distance(int Ax, int Ay, int Bx, int By);The function accepts the coordinates of truck A(Ax, Ay) and the coordinates of truck B(Bx, By), as input. The office is at location (0, 0). Implement the function…