Answer:
5x...................
Let's say that x is sam's age and y is Amy's age
x=y-4
and five years ago:
x-5=(y-5)/2
y-4-5=(y-5)/2
2y-18=y-5
y=13
x=9
then:
sam's age is 9 and Amy's age is 13