Rezultati

Up. imeNalogaJezikRezultatČas oddaje
sSrcem-2018 Presek C++ 0/100Napačen odgovor (WA) 04. okt '18 @ 19:20

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

Ocenjevani program (geometrijasmrdi.cpp):
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main(){

    //cin stpon,for stpon

    int stpon;
    cin>>stpon;

    for(int xy = 0; xy < stpon; xy++){
    int x1,x2,y1,y2,xk,yk,r;
   cin>>x1>>y1>>x2>>y2>>xk>>yk>>r;

   if( (x1 > xk + r) || (y1 > yk + r) || (x2 < xk - r) || (y1 < yk - r) )
    cout<<"Presek je prazen"<<endl;


   else if(yk<= y2 && yk >= y1 && (xk + r == x1) )
    cout<< x1<< " "<< yk<<endl;
   else if(yk<= y2 && yk >= y1 && (xk- r == x2))
   cout<< x2<< " "<< yk<<endl;

    else if(xk<= x2 && xk >= x1 && (yk + r == y1) )
    cout<< y1<< " "<< xk<<endl;
   else if(xk<= x2 && xk >= x1 && (yk- r == y2))
   cout<< y2<< " "<< xk<<endl;



   else if (xk <= x2 && xk >= x1 && y1<yk +r  )
    cout<<xk<<" "<< y1<<endl;
      else if (xk <= x2 && xk >= x1 && y2>yk -r  )
    cout<<xk<<" "<< y2<<endl;

       else if (yk <= y2 && yk >= y1 && x1<xk +r  )
    cout<<yk<<" "<< x1<<endl;
      else if (yk <= y2 && yk >= y1 && x2>xk -r  )
    cout<<yk<<" "<< x2<<endl;
    }
   // cout<<"Lep pozdrav ocenjevalnim algoritmom";


    return 0;
}