Let the amounts borrowed be A and B=5000-A.
Let X be the interest on A, so X=7AT/100 and 380-X=8.5(5000-A)T/100, and T=time over which the money was borrowed.
AT=100X/7, so 380-X=(8.5*5000T-8.5AT)/100.
38000-100X=42500T-850X/7; 266000-700X=297500T-850X; 150X=297500T-266000. 3X=5950T-5320=5949T+T-5319-1. X=(1983T-1773)+(T-1)/3.
If T=1, X=$210 and A=$3000 (21000/7) making B=$2000.
If T=2, X=$2193.33 which is clearly in excess of total interest of $380.
5950T>5320 so that X>0, therefore T>76/85. When T=76/85 yr X=0, which implies no interest, when we know the interest accumulated is $380. So it seems reasonable to suppose T=1 year.