Advertisement
Guest User

Untitled

a guest
Sep 12th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 2.77 KB | None | 0 0
  1. import javafx.util.Pair;
  2.  
  3. import java.io.*;
  4. import java.lang.reflect.Array;
  5. import java.nio.channels.InterruptedByTimeoutException;
  6. import java.util.*;
  7. import java.io.IOException;
  8. import java.io.InputStream;
  9.  
  10. public class anime {
  11.     public static void main(String[] args) throws IOException {
  12.         InputStream inputStream = System.in;
  13.         OutputStream outputStream = System.out;
  14.         InputReader in = new InputReader(inputStream);
  15.         PrintWriter out = new PrintWriter(outputStream);
  16.         Task solver = new Task();
  17.         int t = 1;
  18.         for(int i = 0; i < t; i++) {
  19.             solver.solve(in, out);
  20.         }
  21.         out.close();
  22.     }
  23.  
  24.     static class Task {
  25.         public void solve(InputReader in, PrintWriter out) throws IOException {
  26.              
  27.         }
  28.  
  29.         private long gcd(long a, long b) {
  30.             while (b > 0) {
  31.                 long t = a % b;
  32.                 a = b;
  33.                 b = t;
  34.             }
  35.             return a;
  36.         }
  37.     }
  38.  
  39.     static class InputReader {
  40.         public BufferedReader reader;
  41.         public StringTokenizer tokenizer;
  42.  
  43.         public InputReader(InputStream stream) {
  44.             reader = new BufferedReader(new InputStreamReader(stream), 32768);
  45.             tokenizer = null;
  46.         }
  47.  
  48.         public String next() {
  49.             while (tokenizer == null || !tokenizer.hasMoreTokens()) {
  50.                 try {
  51.                     tokenizer = new StringTokenizer(reader.readLine());
  52.                 } catch (IOException e) {
  53.                     throw new RuntimeException(e);
  54.                 }
  55.             }
  56.             return tokenizer.nextToken();
  57.         }
  58.  
  59.         public long nextLong() {
  60.             return Long.parseLong(next());
  61.         }
  62.         public int nextInt() {
  63.             return Integer.parseInt(next());
  64.         }
  65.     }
  66.  
  67.     static class pll implements Comparable<pll> {
  68.         public long first;
  69.         public long second;
  70.  
  71.         public static pll makePair(long first, long second) {
  72.             return new pll(first, second);
  73.         }
  74.  
  75.         public pll(long first, long second) {
  76.             this.first = first;
  77.             this.second = second;
  78.         }
  79.  
  80.         public int equals(pll o) {
  81.             if(o.first > this.first) return -1;
  82.             if(o.first < this.first) return 1;
  83.             if(o.first == this.first && o.second > this.second) return -1;
  84.             if(o.first == this.first && o.second < this.second) return 1;
  85.             return 0;
  86.  
  87.         }
  88.  
  89.         public int compareTo(pll o) {
  90.             int value = Long.compare(first, o.first);
  91.             if (value != 0) {
  92.                 return value;
  93.             }
  94.             return Long.compare(second, o.second);
  95.         }
  96.  
  97.     }
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement