Skip to main content
added 21 characters in body
Source Link
Dead Possum
  • 3.5k
  • 14
  • 25

Python 2, 4139 bytes

-2 bytes thanks to ovs

lambda a,b:~-a*(a*b%2)and([0,a/2,b/2)or(0,0)b/2][a>1==a*b%2::2] 

Try it online!Try it online!

Python 2, 41 bytes

lambda a,b:~-a*(a*b%2)and(a/2,b/2)or(0,0) 

Try it online!

Python 2, 39 bytes

-2 bytes thanks to ovs

lambda a,b:[0,a/2,0,b/2][a>1==a*b%2::2] 

Try it online!

Source Link
Dead Possum
  • 3.5k
  • 14
  • 25

Python 2, 41 bytes

lambda a,b:~-a*(a*b%2)and(a/2,b/2)or(0,0) 

Try it online!