THE MULTIPLE OF 3 ARE: 3 , 6 , 9 ,12
The 1st magazine costs either 3 or 6 or 9 , 12
The 2nd magazine costs <span>3 or 6 or 9 , 12
The value 12 is to be discarded , then are the sum of tall possibilities to get 12:
</span>mag 1st mag 2nd total
------------ ------------ --------
3 9 12
6 6 12
9 3 12
Six less the number n - 6= n/2

Hope you could understand.
If you have any query, feel free to ask.
Answer:
I think the distance is 7