Problem M
Particle Collision
Particle colliders are difficult to build and experiments are costly to run. Before running any real experiments it is better to do a simulation to test out the ideas first. You are required to write a very simple simulator for this problem.
There are only three particles in this system, and all
particles are confined to an infinite plane so that they can be
modelled as circles. Their locations are specified only by the
We are given a vector
There are a number of possible scenarios your simulator should identify:
-
particle
hits particle , which in turns hits particle ; -
particle
hits particle , which in turns hits particle ; -
particle
hits particle , which moves indefinitely; -
particle
hits particle , which moves indefinitely; -
particle
moves indefinitely.
Input
The input contains four lines. The first three lines each
contains two integers
You may assume that no two particles touch or overlap
initially, and that the distance between the centers of
particles
Output
Output a single integer giving the number (
Although you should take care of your calculations, it is
guaranteed that the outcome would not change if the initial
vector
Sample Input 1 | Sample Output 1 |
---|---|
0 0 50 45 91 50 42 50 10 |
1 |
Sample Input 2 | Sample Output 2 |
---|---|
0 0 50 50 141 50 41 50 10 |
3 |
Sample Input 3 | Sample Output 3 |
---|---|
0 0 50 50 131 50 100 50 10 |
4 |