|
| 1 | +import java.io.OutputStream; |
| 2 | +import java.io.IOException; |
| 3 | +import java.io.InputStream; |
| 4 | +import java.io.PrintWriter; |
| 5 | +import java.io.IOException; |
| 6 | +import java.io.InputStreamReader; |
| 7 | +import java.io.FileNotFoundException; |
| 8 | +import java.util.StringTokenizer; |
| 9 | +import java.io.BufferedReader; |
| 10 | +import java.io.FileReader; |
| 11 | +import java.io.InputStream; |
| 12 | + |
| 13 | +/** |
| 14 | + * Built using CHelper plug-in |
| 15 | + * Actual solution is at the top |
| 16 | + * |
| 17 | + * @author kronos |
| 18 | + */ |
| 19 | +public class Main { |
| 20 | + public static void main(String[] args) { |
| 21 | + InputStream inputStream = System.in; |
| 22 | + OutputStream outputStream = System.out; |
| 23 | + FastScanner in = new FastScanner(inputStream); |
| 24 | + PrintWriter out = new PrintWriter(outputStream); |
| 25 | + Task1246 solver = new Task1246(); |
| 26 | + solver.solve(1, in, out); |
| 27 | + out.close(); |
| 28 | + } |
| 29 | + |
| 30 | + static class Task1246 { |
| 31 | + public void solve(int testNumber, FastScanner in, PrintWriter out) { |
| 32 | + int n = in.nextInt() - 1; |
| 33 | + long z = 0, fx, fy; |
| 34 | + long x1, y1, x2 = 0, y2 = 0;//,x3,y3; |
| 35 | + fx = x1 = in.nextLong(); |
| 36 | + fy = y1 = in.nextLong(); |
| 37 | + while (n > 0) { |
| 38 | + x2 = in.nextLong(); |
| 39 | + y2 = in.nextLong(); |
| 40 | + z += x1 * y2 - x2 * y1; |
| 41 | + x1 = x2; |
| 42 | + y1 = y2; |
| 43 | + n--; |
| 44 | + } |
| 45 | + |
| 46 | + z += x2 * fy - fx * y2; |
| 47 | + |
| 48 | + if (z < 0) { |
| 49 | + out.println("cw"); |
| 50 | + } else { |
| 51 | + out.println("ccw"); |
| 52 | + } |
| 53 | + } |
| 54 | + |
| 55 | + } |
| 56 | + |
| 57 | + static class FastScanner { |
| 58 | + BufferedReader br; |
| 59 | + StringTokenizer st; |
| 60 | + |
| 61 | + public FastScanner() { |
| 62 | + br = new BufferedReader(new InputStreamReader(System.in)); |
| 63 | + } |
| 64 | + |
| 65 | + public FastScanner(InputStream stream) { |
| 66 | + br = new BufferedReader(new InputStreamReader(stream)); |
| 67 | + } |
| 68 | + |
| 69 | + public FastScanner(String s) { |
| 70 | + try { |
| 71 | + br = new BufferedReader(new FileReader(s)); |
| 72 | + } catch (FileNotFoundException e) { |
| 73 | + e.printStackTrace(); |
| 74 | + } |
| 75 | + } |
| 76 | + |
| 77 | + public String next() { |
| 78 | + while (st == null || !st.hasMoreTokens()) { |
| 79 | + try { |
| 80 | + st = new StringTokenizer(br.readLine()); |
| 81 | + } catch (IOException e) { |
| 82 | + } |
| 83 | + } |
| 84 | + return st.nextToken(); |
| 85 | + } |
| 86 | + |
| 87 | + public int nextInt() { |
| 88 | + return Integer.parseInt(next()); |
| 89 | + } |
| 90 | + |
| 91 | + public long nextLong() { |
| 92 | + return Long.parseLong(next()); |
| 93 | + } |
| 94 | + |
| 95 | + } |
| 96 | +} |
0 commit comments