The number of Eric’s $5 to $10 was 3:2 at first. He used 1/5 of his $10 and some $5 notes to pay for a gift. The ratio of the number of $5 notes to $10 notes spent on the gift was 3:1. If the amount of $5 notes left was $360, how much did the gift cost?

number of fives --- 3x

number of tens ---- 2x

cost of gift = (1/5)(2x) + k(3x) , in terms of number of bills
= 2x/5 + 3kx

2x/5 / 3kx = 1/3
3kx = 6x/5
k = 2/5

number of fives spent = (2/5)(3x) = 6x/5
in terms of value:
five left = 3x - 6x/5 = 9x/5

value of fives left = 5(9x/5) = 360
x = 40

cost of gift = $10(2x/5) + $5(3kx)
= $10(80/5) + $5(3)(2/5)(40) = $160 + $240 = $400