Cutting Boards

  • + 10 comments

    Hints: Make sure your types are long, not int, because even if the value of costs are up to 10^9, when multiplied with the number of cuts they overflow. Obviously the result needs to be long as well, BUT make sure you display it modulo 1000000007 (for whatever weird reason, it is part of the problem text)