Little Tom loves playing games. One day he downloads a computer game called 'Striking Ball', which makes him very excited. The game field is a rectangular window, and there are many rectangular bricks of the same size in it. A ‘striking ball’ is bouncing in that window. Every brick is placed parallel to the window’s bottom line. At the beginning of the game, little Tom may put the ball at any position on the bottom line of the window and launch it in any direction upwards. Then the striking ball will change its direction only when it hits the bricks or the border of the window. The ball changes its direction according to the light reflection rule. A brick will disappear immediately when hit by the ball. Every striking at the brick brings little Tom the amount of points which the brick owns. Once the striking ball touches the bottom line, the game ends.
Given the launching position and direction of the striking ball, little Tom wants to know how many points in total he will get during the game.
You may ignore the volume of the ball and just regard it as a point.
This is a picture showing that a ball is launched from coordinate X on the bottom line of the window, and the launch angle is α.