시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 64 5 3 8.571%

문제

희원이는 지난 몇 년동안 원형 시계를 수집한 수집가이다. 이 시계는 모두 거실의 한 벽에 걸려있다. 이번에 큰 돈을 벌게된 희원이는 시계를 하나 더 사려고 한다. 이 때, 벽에 있는 시계의 위치를 건드리지 않으면서 매달 수 있는 가장 큰 시계를 구매하려고 한다.

벽은 너비 W, 높이 H의 직사각형 모양이다. 각 시계의 중심 좌표는 (xi, yi)이고, 반지름은 ri이다. 희원이의 시계는 벽의 경계와 겹치거나 다른 시계와 겹치지 않는다. 하지만, 서로 접할 수는 있다.

입력

첫째 줄에 테스트 케이스의 개수가 주어진다. 각 테스트 케이스의 첫째 줄에는 벽의 너비와 높이 W, H가 주어진다. (1 ≤ W,H ≤ 1,000,000) 다음 줄에는 벽에 걸려있는 시계의 수 C(0 ≤ C ≤ 50)가 주어진다. 다음 C개 줄에는 각 시계의 정보 xi, yi, ri가 주어진다. (ri > 0, 0 ≤ xi - ri, xi + ri ≤ W, 0 ≤ yi - ri, yi + ri ≤ H)

모든 시계의 쌍 i와 j (i ≠ j)는 (xi - xj)2 + (yi - yj)2 ≥ (ri + rj)2 를 만족한다. 

출력

각 테스트 케이스에 대해서, 희원이가 구매할 수 있는 가장 큰 시계의 반지름을 출력한다. 정답과의 오차는 10-6까지 허용한다.

예제 입력 1

1
10 10
4
2 2 1
2 8 1
8 2 1
8 8 1

예제 출력 1

3.242640687119285
W3sicHJvYmxlbV9pZCI6IjUzOTQiLCJwcm9ibGVtX2xhbmciOiIwIiwidGl0bGUiOiJcdWMyZGNcdWFjYzQiLCJkZXNjcmlwdGlvbiI6IjxwPlxyXG5cdFx1ZDc2Y1x1YzZkMFx1Yzc3NFx1YjI5NCBcdWM5YzBcdWIwOWMgXHViYTg3IFx1YjE0NFx1YjNkOVx1YzU0OCBcdWM2ZDBcdWQ2MTUgXHVjMmRjXHVhY2M0XHViOTdjIFx1YzIxOFx1YzlkMVx1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