The intersection of two squares with a perimeter of $8$ is a rectangle with a diagonal length of $1$. Given that the distance between the centers of the two squares is $2$, the perimeter of the rectangle can be expressed as $P$. Find $10P$.

Let's think step by step and output the final answer within \boxed{}.
user