#11122: 解法參考


g0410573 (unknown)


a b 是大公因數的倍數,所以最小就是a

小公倍數=a*b/大公因數

a=大公因數,所以b=小公倍數

另外 小公倍數 是 大公因數 的倍數

所以 小公倍數%大公因數!=0 輸出 -1