import java.util.*;

public class FoodProcessor_AN {
  static class Blade {
    int M, H;
    public Blade(int M, int H) {
      this.M = M;
      this.H = H;
    }
  }

  public static void main(String[] args) {
    Scanner s = new Scanner(System.in);
    int S = s.nextInt(), T = s.nextInt(), N = s.nextInt();
    Blade[] blades = new Blade[N];
    for (int i = 0; i < N; i++) {
      blades[i] = new Blade(s.nextInt(), s.nextInt());
    }
    Arrays.sort(blades, (Blade o1, Blade o2)->Integer.compare(o2.M, o1.M));
    if (blades[0].M < S) {
      System.out.println(-1);
      return;
    }
    int cur = 0;
    double ans = 0;
    for (int i = 1; i < N; i++) {
      if (blades[i].M <= T) break;
      if (blades[i].H < blades[cur].H) {
        if (blades[i].M < S) {
          ans += process(Math.min(S, blades[cur].M), blades[i].M, blades[cur].H);
        }
        cur = i;
      }
    }
    ans += process(Math.min(S, blades[cur].M), T, blades[cur].H);
    System.out.println(ans);
  }

  // s * (0.5 ^ (x / h)) = t => (x / h) ln 0.5 = ln (t / s)
  static double process(double s, double t, int h) {
    return h * Math.log(t / s) / Math.log(0.5);
  }
}
