import java.util.Arrays;
import java.util.Scanner;
class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
while ( true )
{
int tc = sc.nextInt();
double[][] t = new double[tc][2];
int idx =0;
if (tc==0) break;
double x, y ,mx=0;
for(int i=0;i<tc;i++) {
x =sc.nextDouble();
y = sc.nextDouble();
double [] mi = new double [3];
mi[0] = Math.min(x, y/4.0);
mi[1] = Math.min(x/4.0, y);
mi[2] = Math.min(x, y)/2.0;
Arrays.sort(mi);
if (mx< mi[2]) {
mx= mi[2];
idx = i+1;
}
}
System.out.println(idx);
}
}
}
import java.util.Scanner;
class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
while ( true )
{
int tc = sc.nextInt();
double[][] t = new double[tc][2];
int idx =0;
if (tc==0) break;
double x, y ,mx=0;
for(int i=0;i<tc;i++) {
x =sc.nextDouble();
y = sc.nextDouble();
double [] mi = new double [3];
mi[0] = Math.min(x, y/4.0);
mi[1] = Math.min(x/4.0, y);
mi[2] = Math.min(x, y)/2.0;
Arrays.sort(mi);
if (mx< mi[2]) {
mx= mi[2];
idx = i+1;
}
}
System.out.println(idx);
}
}
}
No comments :
Post a Comment