Rezultati

Up. imeNalogaJezikRezultatČas oddaje
rokavcki-2018 Presek Python 3 0/100Napačen odgovor (WA) 04. okt '18 @ 17:24

Test Točke Porabljen spomin Porabljen čas Status
#1 0/100 8,469 MiB 0,000 s Napačen odgovor

Ocenjevani program (presek.py):
n = int(input())
for i in range(n):
    x1, y1, x2, y2, xk, yk, r = map(int, input().split())

    circle_x = [xk-r, xk, xk+r, xk]
    circle_y = [yk, yk-r, yk, yk+r]

    presek = False

    # check 1
    for j in range(4):
        if x1 <= circle_x[j] <= x2 and y1 <= circle_y[j] <= y2 and not presek:
            print(str(circle_x[j])+" "+str(circle_y[j]))
            presek = True

    square_x = [x1,x2,x1,x2]
    square_y = [y1,y1,y2,y2]

    # check 2
    for j in range(4):
        if (square_x[j] - xk) ** 2 + (square_y[j] - yk) ** 2 <= r**2 and not presek:
            print(square_x[j], square_y[j])
            presek = True

    if not presek:
        print('Presek je prazen')