The smaller square in the figure below has a perimeter of 4 cm, and the larger square has an area of 25 cm^2. What is the distance from point A to point B? Express your answer as a decimal to the nearest tenth.