from math import sqrt
import sys
n,l = map(int,input().split())
nums = []
for i in range(n):
a,b = sys.stdin.readline().split()
a = int(a)
b = int(b)
nums.append((a,b))
lo = 0
hi = 500000000
def check(x):
intervals = []
curr = 0
for i in nums:
a,b = i[0],i[1]
bruh = (x-b)*(x+b)
if bruh>=0:
c = sqrt(bruh)
part1 = a-c
part2 = a+c
if part1 <= curr and part2 > curr:
curr = part2
if curr>=l:
return True
return False
while hi - lo > 0.001:
mid = (hi+lo)/2
if check(mid):
hi = mid
else:
lo = mid
sys.stdout.write(str(lo)+"\n")
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
32 ms |
18168 KB |
Output is correct |
2 |
Correct |
33 ms |
18200 KB |
Output is correct |
3 |
Correct |
34 ms |
18224 KB |
Output is correct |
4 |
Correct |
33 ms |
18216 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
36 ms |
18848 KB |
Output is correct |
2 |
Correct |
39 ms |
19036 KB |
Output is correct |
3 |
Correct |
52 ms |
18848 KB |
Output is correct |
4 |
Correct |
42 ms |
18928 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
56 ms |
20032 KB |
Output is correct |
2 |
Correct |
51 ms |
19604 KB |
Output is correct |
3 |
Correct |
53 ms |
19796 KB |
Output is correct |
4 |
Correct |
51 ms |
19740 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
56 ms |
20492 KB |
Output is correct |
2 |
Correct |
50 ms |
19956 KB |
Output is correct |
3 |
Correct |
60 ms |
20092 KB |
Output is correct |
4 |
Correct |
71 ms |
20216 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
70 ms |
20292 KB |
Output is correct |
2 |
Correct |
49 ms |
19956 KB |
Output is correct |
3 |
Correct |
57 ms |
20060 KB |
Output is correct |
4 |
Correct |
57 ms |
20268 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
68 ms |
20332 KB |
Output is correct |
2 |
Correct |
49 ms |
19940 KB |
Output is correct |
3 |
Correct |
53 ms |
20032 KB |
Output is correct |
4 |
Correct |
58 ms |
20128 KB |
Output is correct |
5 |
Correct |
67 ms |
20468 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
103 ms |
26832 KB |
Output is correct |
2 |
Correct |
81 ms |
27168 KB |
Output is correct |
3 |
Correct |
76 ms |
25520 KB |
Output is correct |
4 |
Correct |
95 ms |
27296 KB |
Output is correct |
5 |
Correct |
75 ms |
24712 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
91 ms |
26672 KB |
Output is correct |
2 |
Correct |
88 ms |
26844 KB |
Output is correct |
3 |
Correct |
95 ms |
27156 KB |
Output is correct |
4 |
Correct |
135 ms |
27344 KB |
Output is correct |
5 |
Correct |
97 ms |
27484 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
85 ms |
26744 KB |
Output is correct |
2 |
Correct |
80 ms |
27164 KB |
Output is correct |
3 |
Correct |
96 ms |
27076 KB |
Output is correct |
4 |
Correct |
111 ms |
28084 KB |
Output is correct |
5 |
Correct |
92 ms |
26976 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
99 ms |
27612 KB |
Output is correct |
2 |
Correct |
92 ms |
27448 KB |
Output is correct |
3 |
Correct |
101 ms |
26976 KB |
Output is correct |
4 |
Correct |
123 ms |
28220 KB |
Output is correct |
5 |
Correct |
115 ms |
27308 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
124 ms |
27488 KB |
Output is correct |
2 |
Correct |
97 ms |
27416 KB |
Output is correct |
3 |
Correct |
104 ms |
26960 KB |
Output is correct |
4 |
Correct |
119 ms |
28820 KB |
Output is correct |
5 |
Correct |
101 ms |
27328 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
314 ms |
51288 KB |
Output is correct |
2 |
Correct |
314 ms |
54536 KB |
Output is correct |
3 |
Correct |
277 ms |
54032 KB |
Output is correct |
4 |
Correct |
372 ms |
56464 KB |
Output is correct |
5 |
Correct |
316 ms |
53560 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
354 ms |
55176 KB |
Output is correct |
2 |
Correct |
474 ms |
53632 KB |
Output is correct |
3 |
Correct |
359 ms |
52756 KB |
Output is correct |
4 |
Correct |
345 ms |
56056 KB |
Output is correct |
5 |
Correct |
320 ms |
54172 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
371 ms |
55660 KB |
Output is correct |
2 |
Correct |
398 ms |
59804 KB |
Output is correct |
3 |
Correct |
314 ms |
59352 KB |
Output is correct |
4 |
Correct |
405 ms |
62916 KB |
Output is correct |
5 |
Correct |
357 ms |
58648 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
390 ms |
60000 KB |
Output is correct |
2 |
Correct |
520 ms |
58380 KB |
Output is correct |
3 |
Correct |
367 ms |
57404 KB |
Output is correct |
4 |
Correct |
407 ms |
62948 KB |
Output is correct |
5 |
Correct |
387 ms |
59308 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
435 ms |
65068 KB |
Output is correct |
2 |
Correct |
404 ms |
69792 KB |
Output is correct |
3 |
Correct |
392 ms |
69116 KB |
Output is correct |
4 |
Correct |
465 ms |
72296 KB |
Output is correct |
5 |
Correct |
421 ms |
68020 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
440 ms |
70456 KB |
Output is correct |
2 |
Correct |
580 ms |
68232 KB |
Output is correct |
3 |
Correct |
457 ms |
67328 KB |
Output is correct |
4 |
Correct |
493 ms |
72400 KB |
Output is correct |
5 |
Correct |
426 ms |
69088 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
493 ms |
68856 KB |
Output is correct |
2 |
Correct |
496 ms |
74404 KB |
Output is correct |
3 |
Correct |
414 ms |
73536 KB |
Output is correct |
4 |
Correct |
532 ms |
78336 KB |
Output is correct |
5 |
Correct |
469 ms |
73192 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
505 ms |
75420 KB |
Output is correct |
2 |
Correct |
659 ms |
73088 KB |
Output is correct |
3 |
Correct |
449 ms |
71888 KB |
Output is correct |
4 |
Correct |
516 ms |
77964 KB |
Output is correct |
5 |
Correct |
486 ms |
74244 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
581 ms |
84628 KB |
Output is correct |
2 |
Correct |
512 ms |
91332 KB |
Output is correct |
3 |
Correct |
574 ms |
90456 KB |
Output is correct |
4 |
Correct |
646 ms |
94884 KB |
Output is correct |
5 |
Correct |
559 ms |
89344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
620 ms |
92192 KB |
Output is correct |
2 |
Correct |
789 ms |
89104 KB |
Output is correct |
3 |
Correct |
598 ms |
88352 KB |
Output is correct |
4 |
Correct |
653 ms |
94948 KB |
Output is correct |
5 |
Correct |
576 ms |
90536 KB |
Output is correct |