#include double cost[110][201], price[110]; int dist[110]; int i,j,k,n,d,stop,next; main(){ scanf("%d",&d); dist[0] = 0; price[0] = 1e99; for (n=1;2==scanf("%d%lf",&dist[n],&price[n]);n++); dist[n] = d; price[n++] = 1e99; for (i=0;i