Let the cost price= Rs x
1)
loss=l=5%
selling price(s1)=x(100-l%)/100
=x(100-5)/100
=95x/100-----(1)
2)
gain (g)=7%
selling price(s2)= x(100+g)/100
= x(100+7)/100
=107x/100-----(2)
but
(2) - (1)=27
107x/100 - 95x/100=27
12x/100=27
x=27*100/12
after cancellation
x=225
therefore
cost price=Rs225