A basketball is 45 yuan, and a football is 76 yuan. The school bought the same amount of basketballs and footballs, with a difference of 248 yuan. How many basketballs and footballs did the school buy?
一个篮球45元，一个足球76元．学校买了相同数量的篮球和足球，相差248元．学校买来篮球和足球各多少个？
<gadget id="calculator">76 - 45</gadget>
<output>31</output>

<gadget id="calculator">248 / 31</gadget>
<output>8</output>

<result>8</result>