You are going to broadcast a football game.
The field of this game is length of \(n\), width of \(m\), and there are \(p\) players who's ready to joint this game.
During the game, there would be some events which you need to handle.
Type 1: A player numbered \(player_id\) has catched the ball.
Type 2: The player who's having the ball has kicked it along the direction of (\(dx\), \(dy\)). The ball would stop moving if it has hit the boundary of this field (\(x = 0\), \(x = n-1\), \(y = 0\), \(y = m-1\)), or any player on its way, except the players who was standing at its initial position.
Type 3: The player who's having the ball has kicked it along the direction of (\(dx\), \(dy\)). The ball would stop moving if it has hit any player on its way, except the players who was standing at its initial position. Even if the ball has hit the boundary of the field, it'll keep moing until it cannot move in each direction. (Check the figure below for better understanding)
Type 4: The player who's having the ball has kicked it along the direction of (\(dx\), \(dy\)). The ball would stop moving if it has hit any player on its way, except the players who was standing at its initial position. If the ball has hit the boundary of the field, it'll rebound once and then follow the mechanism as ball in Type 3. (Check the figure below for better understanding)
Type 5: You have to report the current state of this game.
In the example of type 3 above, the following events have happened. 1. The ball has hit the boundary of x = n-1, dx becomes 0. 2. The ball has hit the boundary of y = 0, dy becomes 0. 3. dx = 0 and dy = 0, the ball had stop moving.
In the example of type 4 above, the following events have happened. 1. The ball has hit the boundary of x = n-1, dx *= -1. 2. The ball has hit the boundary of y = 0, dy becomes 0. 3. The ball is flying along its direction...
In this problem, event except type 2, 3, 4 has been implemented for you. You have to implement the function handleBallKicked for type 2, 3, function handleBallKickedRebounce for type 4.