Bouncing DVD (bouncing)

2 teams scored 20 points on this task, for a maximum score of 10, an average score of 10 and a median score of 10.

Highlights

  1. L. Scientifico A. Romita, Campobasso is the institute with the most points (10).
  2. Molise is the region with the most points (10).

Statement

One of Valerio's hobbies is watching the DVD logo bounce around the screen. He enjoys it so much that he starts mimicking the motion in his living room! Valerio's living room is a W× H axis-aligned rectangular space. He starts at position (x_1, y_1) with an initial velocity (vx, vy), meaning that each second, he moves vx units along the x-axis and vy units along the y-axis. Whenever he hits a wall, he bounces off, reversing direction along the corresponding axis while maintaining the same speed. However, Valerio accidentally left the TV remote on the floor at position (x_2, y_2). Every time he steps on this point, he unintentionally presses the off button on the remote, stopping the bouncing DVD logo -- and making Valerio frustrated! Valerio has exactly T seconds to enjoy his bouncing before he must stop and return to his duties. Count how many times he steps on the remote and presses the off button during this time.