eval"A,B="+gets.split*?, p A.gcd(B)>1?-1:~-A*~-B/2