Submit | All submissions | Best solutions | Back to list |
HS10CXQL - Convex Quadrilaterals |
Given coordinates of 4 points on the plane compute if they are vertices of a convex quadrilateral.
Input data specification
First t, the number of test cases. In the each of the following t lines 8 positive integers x1, y1, x2, y2, x3, y3, x4, y4 ≤ 1000 - the coordinates of 4 points: (x1, y1), (x2, y2), (x3, y3), (x4, y4).
Output data specification
For each test in the separate line one character
- Y, if given points are vertices of convex quadrilateral.
- N, in the opposite case.
Example
Input: 5 100 100 100 200 200 200 200 100 630 421 326 242 561 432 478 332 378 212 380 550 840 735 379 381 591 916 765 191 487 490 678 554 975 75 324 166 343 28 650 120 Output: Y N N Y N
Scoring
Solving this problem you score 10 points.
Added by: | kuszi |
Date: | 2011-01-29 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | ADA95 ASM32 ASM64 BASH BF C CSHARP C++ 4.3.2 CPP C99 CLPS CLOJURE LISP sbcl LISP clisp D ERL FSHARP FORTRAN GO HASK ICON JAVA JS-RHINO LUA NEM NICE OCAML PAS-GPC PAS-FPC PERL PERL6 PHP PIKE PRLG-swi PYTHON PYTHON3 RUBY SCALA SCM guile SCM qobi ST TCL WHITESPACE |
Resource: | High School Programming League 2010/11 |