import java.util.*;
//codejam 2018 practice round Question C:Speed 2
class Horse{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int t=0;
while(sc.hasNextInt()) {
t=sc.nextInt();
break;
}
double ans[]=new double[t];
int q;
for(q=0;q<t;q++){
int d=0,nh=0;
while(sc.hasNextInt()) {
d=sc.nextInt();
nh=sc.nextInt();
break;
}
double max_time=0.0;
for(int i=0;i<nh;i++){
int td=sc.nextInt();
int ts=sc.nextInt();
int tt=(d-td)/ts;
if(tt>max_time){max_time=tt;}
}
double num_ans=d/max_time;
ans[q]=(double)Math.round(num_ans*1000000)/1000000;
}
for(q=0;q<t;q++){
int e=q+1;
System.out.println("Case #"+e+": "+ans[q]);
}
}
}
--
You received this message because you are subscribed to the Google Groups
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-code/01264639-92dc-40f9-997c-9994d543097c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.