20250920 baekjoon

This commit is contained in:
songyc macbook 2025-09-20 20:00:07 +09:00
parent 51d4b229f5
commit bad5f66373

View File

@ -0,0 +1,23 @@
import sys
input = sys.stdin.readline
def pow_dist(x1, y1, x2, y2) :
return (x1-x2)**2 + (y1-y2)**2
for _ in range(int(input())) :
x1, y1, x2, y2 = map(int, input().split())
count = 0
for _ in range(int(input())) :
cx, cy, cr = map(int, input().split())
dist1 = pow_dist(x1,y1,cx,cy)
dist2 = pow_dist(x2,y2,cx,cy)
pow_cr = cr**2
if pow_cr > dist1 and pow_cr > dist2 :
pass
elif pow_cr > dist1 or pow_cr > dist2 :
count += 1
print(count)