Revizia anterioară Revizia următoare
Fişierul intrare/ieşire: | arbsat.in, arbsat.out | Sursă | Algoritmiada 2012, Runda Finala |
Autor | Cosmin Gheorghe | Adăugată de | |
Timp execuţie pe test | 0.75 sec | Limită de memorie | 65536 kbytes |
Scorul tău | N/A | Dificultate | N/A |
Vezi solutiile trimise | Statistici
Arbsat
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.
Input
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.
Output
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.
Restrictions
- 1 ≤ T ≤ 6
- 1 ≤ N ≤ 100.000
- All the coordinates are positive, strictly greater than 0.
Example
arbsat.in | arbsat.out |
---|---|
2 4 1 1 3 5 2 4 8 8 3 10 9 13 9 10 8 | 0 1 |