문제1292--Radar Finder

1292: Radar Finder

실행시간 제한: 1 Sec  메모리사용 제한: 128 MB
제출: 137  통과: 27
[제출] [채점기록] [묻고답하기]

문제 설명

You are the commander of a military operation that is focused on determining the location of an enemy unit. Two radar stations have provided measurements of their calculated distance from the enemy unit. You are given the locations of your radar stations in integers x1, y1 and x2, y2, and the calculated distances in integers r1 and r2, respectively.

You are to compute an integer indicating the number of possible locations of the enemy unit. If there are an infinite number of possible locations, return -1.

입력 설명

 The first line contains the number of test cases T (T ≤ 500).

For each test case, x1, y1, r1, x2, y2, r2 will be given on a single line.

  • x1, y1, x2, y2 will be between -1000000000 and 1000000000, inclusive.

  • r1, r2 will be between 1 and 1000000000, inclusive.

출력 설명

 Output the answer of each test case on a separate line.

입력 예시 Copy

2
0 0 13 40 0 37
0 0 3 0 7 4 

출력 예시 Copy

2
1

출처/분류