summaryrefslogtreecommitdiff
path: root/06/main.py
blob: 8418a4a37cc528b2da12387b0ccb9552683529c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/python3
import sys
from math import sqrt

max_time = int(input().split(":")[1].replace(' ', ''))
record_dist = int(input().split(":")[1].replace(' ', ''))

lower_bound = ( max_time - sqrt( max_time ** 2 - 4 * record_dist ) ) / 2
upper_bound = ( max_time + sqrt( max_time ** 2 - 4 * record_dist ) ) / 2
possible_distances = round(abs(lower_bound - upper_bound))

print(f">> {possible_distances}")