275 teams scored 10860 points on this task, for a maximum score of 100, an average score of 39.5 and a median score of 20.
A courtyard is paved with square tiles, and positions are described by integer coordinates on a 2D plane. A ball starts at (\mathttBx, \mathttBy) and a dog named Rex starts at (\mathttDx, \mathttDy). The ball begins moving immediately in direction \mathttdir at constant speed \mathttBs squares per second, where \mathttdir is one of 'U' (up, increasing y), 'D' (down, decreasing y), 'L' (left, decreasing x), or 'R' (right, increasing x). Rex chases the ball at constant speed \mathttDs squares per second, but he must follow the straight paths between tiles: he may move only horizontally or vertically (diagonal shortcuts are not allowed). Compute the minimum time T (in seconds) Rex needs to reach the ball. If T is not an integer, output \lceil T\rceil. If Rex can never reach the ball, output -1.