Rezultati

Up. imeNalogaJezikRezultatČas oddaje
jam-2018 Presek Python 3 100/100OK 04. okt '18 @ 16:45

Test Točke Porabljen spomin Porabljen čas Status
#1 100/100 8,520 MiB 0,000 s OK

Ocenjevani program (main.py):
n = int(input())
for yads in range(n):
    vrstica = map(int, input().split(' '))

    x1, y1, x2, y2, a, b, r = vrstica

    def jeNoter(x, y):
        return (a - x)*(a - x) + (b - y)*(b - y) <= r * r

    sez = [(x1, y1), (x2, y1), (x1, y2), (x2, y2)]

    done = False

    for x, y in sez:
        if(jeNoter(x,y)):
            print(x, y)
            done = True
            break

    if(not done):
        if(y1 <= b <= y2 and x2 + r >= a and a >= x2):
            print(x2, b)
        elif(y1 <= b <= y2 and x1 - r <= a and a <= x1):
            print(x1, b)
        elif(x1 <= a <= x2 and y2 + r >= b and b >= y2):
            print(a, y2)
        elif(x1 <= a <= x2 and y1 - r <= b and b <= y1):
            print(a, y1)
        elif(x1 <= a <= x2 and y1 <= b <= y2):
            print(a, b)
        else:
            print("Presek je prazen")