/* * Solution for Squares */ import java.util.*; import java.io.*; import java.math.*; public class SquMipiMap { public static long gcd(long a,long b){ if (b==0) return a; else return gcd(b,a%b); } public static class Functional implements Comparable{ long x; long y; long v; public Functional(long x1, long y1, long x2, long y2){ y=x1-x2; x=y2-y1; if ((x<0)||(x==0 && y<0)){ x=-x; y=-y; } long d = gcd(Math.abs(x),Math.abs(y)); x/=d; y/=d; v=x*x1+y*y1; } public Functional(Functional f){x=f.x; y=f.y; v=f.v;} public int quadrant(){ if (y>0) return 1; else return 0; } public int compareTo(Functional f) { long k = x*f.y-y*f.x; if (k!=0) return (k<0)?(1):(-1); if (v==f.v) return 0; return (v r1,ArrayList r2){ long ret=0; HashMap p = new HashMap(); for(int j=0;j q0 = new ArrayList(); ArrayList q1 = new ArrayList(); String line=bf.readLine(); StringTokenizer st = new StringTokenizer(line); int n = Integer.parseInt(st.nextToken()); for(int i=0;i r1 = new ArrayList(); ArrayList r2 = new ArrayList(); while(c