Mai intai trebuie sa te autentifici.
Diferente pentru problema/arbsat intre reviziile #2 si #1
Nu exista diferente intre titluri.
Diferente intre continut:
== include(page="template/taskheader" task_id="arbsat") ==
Sedaunnumarnatural $T$siapoi$T$ testede forma:un numarnatural $N$,urmat de $N$ punctede coordonateintregi. Pentrufiecaredintrecele $T$ teste,trebuiesa seafiseze$1$dacapuncteledaterespectaurmatoareaconditie:oricedreptunghide ariemaimareca $0$ determinat dedouadintrecele$N$ puncte, continecel putinunaltpunct in interiorsaupemargini. Incazcontrar programulva afisa$0$.
You are given a natural number, $T$, and $T$ testcases in the following format: a natural number $N$ followed by $N$ points with integer coordinates. For each of the $T$ tests, your program should print $1$ if the given points respect the following condition: any rectangle of positive area (greater than $0$), determined by any two of the $N$ points, contains at least another one of the $N$ points either inside or on the borders. If the condition is not satifsied, your program should print $0$ for that testcase.
h2.Date de intrare
h2. Input
Fişieruldeintrare $arbsat.in$vacontinepeprimalinie $T$, numaruldeteste.Urmeaza$T$ testede forma: $N$, numaruldepuncte,siapoi$N$ linii reprezentandcoordonateleinplan ale punctelor date.
The input file $arbsat.in$ will contain on the first line $T$, the number of testcases. $T$ tests follow, in the following format: $N$, the number of points, then $N$ lines having the coordinates of the points.
h2.Date de ieşire
h2. Output
În fişieruldeieşire$arbsat.out$sevor gasi $T$linii, cuvalori$0$sau$1$,a$i$-adintreacesteacorespunzandraspunsuluipentrual$i$-leatestdinfisieruldeintrare.
The output file $arbsat.out$ will contain $T$ values of $0$ or $1$, on separate lines, the $i$-th value representing the answer for the $i$-th testcase in the input file.
h2. Restricţii
h2. Restrictions
* $1 ≤ T ≤ 6$ * $1 ≤ N ≤ 100.000$
*Coordonatelepunctelorsuntpozitive, strictmai marica $0$.
* All the coordinates are positive, strictly greater than $0$.
h2. Exemplu
h2. Example
table(example). |_. arbsat.in |_. arbsat.out | | 2