Skip to main content
5 of 5
deleted 65 characters in body
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

05AB1E, 15 14 12 bytes

εDO5÷FR]`-Pd

-2 bytes thanks to @Neil.

Try it online or verify all test cases.

Explanation:

ε        # Map both pairs in the (implicit) input to:
 D       #  Duplicate the pair
  O      #  Pop this duplicate and calculate its sum
   5÷    #  Integer-divide it by 5
     F   #  Loop that many times:
      R  #   Reverse the pair every iteration
         #   (the pair is reversed for odd sums; and remains unchanged for even sums)
]        # Close both the loop and map
         # (all pairs are now in the order [A,B])
 `       # Pop and push both pairs separated to the stack
  -      # Subtract the values of the pairs from one another at the same indices
   P     # Take the product of those two values
    d    # And check that it's non-negative / >=0 (thus no score is decreasing)
         # (after which the result is output implicitly)
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384