The taxi billing regulations in a certain city are as follows: 5 yuan per person within 3 kilometers, and 0.5 yuan for every 0.1 kilometers beyond 3 kilometers. Once when Mr. Wang took a taxi in this city, he paid a total of 12.5 yuan. How many kilometers did Mr. Wang travel by taxi this time?
某城市的出租车计费规定如下：3千米以内每人收5元，超出3千米的，每多行0.1千米再收0.5元．有一次王先生在该城市乘坐出租车时，共付费12.5元．王先生这次乘坐出租车行了多少千米？
<gadget id="calculator">12.5 - 5</gadget>
<output>7.5</output>

<gadget id="calculator">7.5 / 0.5</gadget>
<output>15</output>

<gadget id="calculator">15 * 0.1</gadget>
<output>1.5</output>

<gadget id="calculator">1.5 + 3</gadget>
<output>4.5</output>

<result>4.5</result>