Skip to main content
added 1 character in body
Source Link
Amphibological
  • 1.7k
  • 1
  • 14
  • 24

Haskell, 46 42 bytes

x%y|odd$x*y,x>1=(`div`2)<$>[x,y]|1<2=[0,0] 

Try it online!

*EDIT: -4 bytes thanks to a trick from Arnauld's answer.EDIT: -4 bytes thanks to a trick from Arnauld's answer.

Haskell, 46 42 bytes

x%y|odd$x*y,x>1=(`div`2)<$>[x,y]|1<2=[0,0] 

Try it online!

*EDIT: -4 bytes thanks to a trick from Arnauld's answer.

Haskell, 46 42 bytes

x%y|odd$x*y,x>1=(`div`2)<$>[x,y]|1<2=[0,0] 

Try it online!

EDIT: -4 bytes thanks to a trick from Arnauld's answer.

Source Link
Amphibological
  • 1.7k
  • 1
  • 14
  • 24

Haskell, 46 42 bytes

x%y|odd$x*y,x>1=(`div`2)<$>[x,y]|1<2=[0,0] 

Try it online!

*EDIT: -4 bytes thanks to a trick from Arnauld's answer.