I think the virtual erect image should be 'n' times the size of the object. Assuming that I'm correct I'm giving the solution as follows:
I'm using the old sign convention i.e the direction opposite to the incident light rays is positive.
So, according to my convention the focal length of the convex lens is negative & that of concave lens is positive.
Let the object distance be u. Since linear magnification of the object is n, the image distance is nu ( Here both the object and image distance is positive by my sign convention )
So, for concave lens, the equation involving u is,
1/nu - 1/u = 1/f

u = f (1-n) / n
and for convex lens,
1/nu - 1/u = - 1 / f

u = f (n-1) / n
The above two values of u are ur respective answers.
Note that for concave lens n < 1
and for convex lens n > 1 in case virtual image is produced in both the cases.
Rate me !!