1004번: 어린 왕자
python
T = int(input())
for _ in range(T):
x1, y1, x2, y2 = [int(x) for x in input().split()]
n = int(input())
cnt = 0
for i in range(n):
cx, cy, r = [int(x) for x in input().split()]
cnt += 0 if ((x1 - cx) ** 2 + (y1 - cy) ** 2 > r ** 2) == ((x2 - cx) ** 2 + (y2 - cy) ** 2 > r ** 2) else 1
print(cnt)