This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<stdio.h>
#define oo 0x7fffffff
int h[100005],n,dapx,dapy,t[100005];
double dap;
FILE *in;
int main(){
int i,j,sum=0;
double x,y;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&h[i]);
sum+=h[i];
}
dap=oo;
for(i=0;i<n;i++) scanf("%d",&t[i]);
for(i=0;i<n;i++){
for(j=i+1;j<n;j++){
x=sum-h[i]-h[j];
y=1/((double)t[i])+1/((double)t[j]);
x=x/y;
if(x<dap){
dap=x;
dapx=i+1;
dapy=j+1;
}
}
}
printf("%d %d\n",dapx,dapy);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |