Sample test cases.
Compute the area of a simple polygon, and the direction
(clockwise or counterclockwise) in which its vertices are
given.
Input
Input contains up to test cases. Each test case begins
with an integer
().
Then follow the
vertices of a simple polygon, one per line, each of the form
. The points may be
given in either clockwise or counterclockwise order.
Coordinates are integers with absolute value bounded by
. The input is
terminated by a case beginning with .
Output
For each test case, output a line , where is one of “CW” or
“CCW”, indicating whether the polygon was given in
clockwise or counterclockwise order, respectively. is the area of the polygon, given
with exactly one digit after the decimal point.
Sample Input 1 |
Sample Output 1 |
3
0 0
10 0
0 10
5
41 -6
-24 -74
-51 -6
73 17
-30 -34
0
|
CCW 50.0
CW 3817.5
|