Rezultati

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

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

Ocenjevani program (prva.py):
import sys
import math

sys.setrecursionlimit(10**9)

#sys.stdin = open("a.in")

inp = sys.stdin

T = int(inp.readline())

for line in inp:
    x1,y1,x2,y2,xk,yk,r = map(int, line.split())
    if x1 <= xk <= x2 and y1 <= yk <= y2:
        print(xk, yk)
        continue
    # Spodi:
    if yk < y1:
        if yk + r >= y1:
            if x1 <= xk <= x2:
                print(xk, y1)
                continue
        else:
            print("Presek je prazen")
            continue
    if yk > y2:
        if yk - r <= y2:
            if x1 <= xk <= x2:
                print(xk, y2)
                continue
        else:
            print("Presek je prazen")
            continue
    if xk < x1:
        if xk + r >= x1:
            if y1 <= yk <= y2:
                print(x1,  yk)
                continue
        else:
            print("Presek je prazen")
            continue
    if xk > x2:
        if xk - r <= x2:
            if y1 <= yk <= y2:
                print(x2, yk)
                continue
        else:
            print("Presek je prazen")
            continue
    # Koti

    # ZL
    if (x1-xk)**2 + (y2 -yk)**2 <= r**2:
        print(x1, y2)
        continue
    if (x2-xk)**2 + (y2 -yk)**2 <= r**2:
        print(x2, y2)
        continue

    if (x1-xk)**2 + (y1 -yk)**2 <= r**2:
        print(x1, y1)
        continue

    if (x2-xk)**2 + (y1 -yk)**2 <= r**2:
        print(x2, y1)
        continue
    print("Presek je prazen")