Program time limit: 1 second
Program memory limit: 128 MB
You've found two rings that contain incredible magical power, however, if they ever come into contact with eachother, they will explode killing you in the process. The first ring has radius $r_1$ and the second has radius $r_2$.
You are careful to keep the rings separate, however, you slip and the rings fall onto the floor. The centre of the first ring lands at $(x_1, y_1)$, and the centre of the second ring lands at $(x_2, y_2)$.
Do the rings come into contact, taking you into your untimely demise?
The first and only line of input contains 6 integers, $r_1, x_1, y_1, r_2, x_2, y_2$, stating the radii and positions of each ring.
You should read from standard input.
In Python, you could use the line r1, x1, y1, r2, x2, y2 = list(map(int, input().split()))
.
In C++, you could use the line int r1, x1, y1, r2, x2, y2; cin >> r1 >> x1 >> y1 >> r2 >> x2 >> y2
.
For all test cases:
Output a single line, containing Yes
or No
, stating whether the rings
come into contact.
You should write to standard output.
In Python, you could use the line print(answer)
.
In C or C++, you could use the line printf("%d\n", answer);
.
2 0 0 3 3 3
Yes
Here are the circles drawn by a computer. As we can see, they are touching.
2 0 0 3 1 5
No
Here are the circles drawn by a computer. As we can see, they are not touching.
Your program will be run on the 2 sample cases and 9 secret cases one after another. You must pass all testcases in order to score points. Recall that your final score on the task is the score of your highest scoring submission.
You haven't submitted to this task.