Rezultati

Up. imeNalogaJezikRezultatČas oddaje
Deathmask Presek C++ 0/100Napačen odgovor (WA) 04. okt '18 @ 17:44

Test Točke Porabljen spomin Porabljen čas Status
#1 0/100 3,004 MiB 0,001 s Napačen odgovor

Ocenjevani program (main.cpp):
#include <iostream>
#include <cmath>
using namespace std;

int main()
{
int pred;
cin>>pred;
for (int i=0;i<pred;i++){
    int x1,y1,x2,y2,xk,yk,r;
    cin>>x1>>y1>>x2>>y2>>xk>>yk>>r;
    int m, n , p, q;
    m = xk - r;
    n = xk + r;
    p = yk - r;
    q = yk + r;
    if((yk <= y2 && yk >= y1) && (m <= x2 && m >= x1))
        cout<<m<<" "<<yk<<endl;
    else if ((yk <= y2 && yk >= y1) && (n >= x1 && n <= x2))
        cout<<n<<" "<<yk<<endl;
    else if((xk >= x1 && xk <= x2) && (p <= y2 && p >= y1))
        cout<<xk<<" "<<p<<endl;
    else if ((xk >= x1 && xk <= x2) && (p >= y1 && p <= y2))
        cout<<xk<<" "<<q<<endl;
    else if(m <= x1 &&n >= x2 && p <= y1 && q >= y2)
        cout<<x1<<" "<<y1<<endl;
    else
        cout<<"Presek je prazen"<<endl;
        }
    return 0;
}