solve Problem#12 by BF, calculate factors by sqrt