#P10423. Handshake and Bouncing Ball
Handshake and Bouncing Ball
Handshake and Bouncing Ball
This problem consists of two parts:
Part A: Handshake Problem
An algorithmic conference is organized by Xiao Lan with a total of 50 participants. Each participant shakes hands with every other participant exactly once, except that among 7 specific people, none of them shake hands with each other. Normally, if everyone shook hands with everyone else, the total number of handshakes would be \(\frac{50\times49}{2}\). However, because the 7 individuals did not shake hands among themselves, you must subtract \(\frac{7\times6}{2}\) from that total. Compute the final number of handshakes.
Part B: Bouncing Ball
Inside a rectangle with a length of \(343720\) and a width of \(233333\), a ball (treated as a point) is launched from the top-left corner. Its initial velocity is given such that the horizontal and vertical components are in the ratio \(15:17\), and its speed remains constant. When the ball collides with a side of the rectangle, it reflects with the angle of incidence equal to the angle of reflection. (In the case the ball hits exactly at a corner, it bounces back along the incoming path.) Calculate the total distance traveled by the ball until it returns to the top-left corner for the first time. Round your answer to two decimal places using standard rounding rules.
inputFormat
This problem does not require any input.
outputFormat
Output two lines:
- The first line is an integer representing the number of handshakes.
- The second line is a decimal number (rounded to two decimal places) representing the distance the ball travels.
sample
1204
1100332948.00
</p>