package no245; import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); Vector2[][] seg = new Vector2[n][2]; for(int i=0;i al = new ArrayList<>(); for(int k=0;k{ long x,a; public Event(long x,long a) { this.x = x; this.a = a; } public int compareTo(Event o) { if (x != o.x) { return Long.compare(x, o.x); } return - Long.compare(a, o.a); } public String toString() { return "[" + x + "," + a + "]"; } } class Vector2 { long x = 0; long y = 0; public Vector2(long x,long y) { this.x = x; this.y = y; } public long dot(Vector2 v) { return this.x*v.x+this.y*v.y; } public long cross(Vector2 v) { return this.x*v.y-this.y*v.x; } public Vector2 add(Vector2 v) { return new Vector2(this.x+v.x,this.y+v.y); } public Vector2 subtract(Vector2 v) { return new Vector2(this.x-v.x,this.y-v.y); } public Vector2 multiply(long k) { return new Vector2(k*this.x,k*this.y); } public String toString() { return this.x + " " + this.y; } public boolean equals(Object o) { if (o instanceof Vector2) { Vector2 v = (Vector2) o; return x == v.x && y == v.y; } return super.equals(o); } }