import java.io.*; import java.math.BigInteger; import java.util.*; /** * Created by btk on 2017/03/16. */ public class Main { static FastScanner in; static PrintWriter out; static void solve() { int N=in.nextInt(); long[] x=new long[N]; long[] y=new long[N]; long[] z=new long[N]; ArrayList ar=new ArrayList(); for (int i = 0; i < N; i++) { x[i] = in.nextInt(); y[i] = in.nextInt(); z[i] = in.nextInt(); BigInteger d = BigInteger.ONE; d=d.multiply(BigInteger.valueOf(x[i])); d=d.multiply(BigInteger.valueOf(y[i])); d=d.multiply(BigInteger.valueOf(z[i])); ar.add(new Pair(d,i)); } Collections.sort(ar); int[] dp = new int[N]; int res = 1; for (int i = 0; i < N; i++) { dp[i] = 1; int now=ar.get(i).b; for (int j = 0; j < i; j++) { int prv=ar.get(j).b; if(x[prv] Integer.MAX_VALUE) throw new NumberFormatException(); return (int) nl; } public double nextDouble() { return Double.parseDouble(next());} } class Pair implements Comparable { BigInteger a; int b; public Pair(BigInteger a, int b) { this.a = a; this.b = b; } //(a,b)が一致 @Override public boolean equals(Object o) { if (o instanceof Pair) { Pair p = (Pair) o; return a == p.a && b == p.b; } return super.equals(o); } //辞書順比較 @Override public int compareTo(Pair o) { if (!a.equals(o.a)) { return a.compareTo(o.a); } return Integer.compare(b,o.b); } }