Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import math
- def main():
- answers =[]
- test_cases = int(raw_input())
- for i in range(test_cases):
- raw_input()
- dist = []
- radii = raw_input().split(' ')
- r = int(radii[0])
- R = int(radii[1])
- no_of_cones = int(raw_input())
- for j in range(no_of_cones):
- pos = raw_input().split(' ')
- x = int(pos[0])
- y = int(pos[1])
- d = math.sqrt(x*x+y*y)
- dist.append(max(R-d,d-r))
- answers.append(min(dist))
- for answer in answers: print '%.3f' % answer
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement