import java.io.IOException; import java.util.Arrays; import java.util.Scanner; public class Egor { public static void main(String[] args) throws IOException { Scanner in=new Scanner(System.in); int n=in.nextInt(); orignalScene=new Scenery(n, in); int best=-1; for(int set=0;set<(1<best){ // System.out.println(best+"->"+val+" by "+Arrays.toString(order)); // System.out.println("direction "+direction); // } best=Math.max(best, val); } else for(int i=0;ilast && hitlast && hitd1 && b>d1); } double hitInXCoordinate(Point goal){ Wall other=new Wall(new Point(0,0), goal); boolean hit = !separated(this, other) && !separated(other, this); if(!hit) return -1.0; if(mirrorPlane==0){ double y=goal.y/((double)goal.x)*p1.x; return p1.x*p1.x+y*y; } else{ double x=goal.x/((double)goal.y)*p1.y; return p1.y*p1.y+x*x; } } } static class Point{ int x; int y; Point(int x, int y){ this.x=x; this.y=y; } public Point clone(){ return new Point(x,y); } public String toString(){ return "("+x+","+y+")"; } } }