#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
using namespace std;

const int DIMN = 100005;

int v[DIMN], t[DIMN];

void WA() {
    cout << "0.0" << endl;
    cerr << "translate:wrong" << endl;
    exit(0);
}

int main(int argc, char *argv[]) {
    ifstream fin(argv[1]);
    ifstream fok(argv[2]);
    ifstream fout(argv[3]);

    int N, Q;
    fin >> N >> Q;
    for (int i = 1; i <= N; ++i) {
        fin >> t[i] >> v[i];
        v[i] = (v[i] > 0 ? v[i] : -v[i]);
    }
    for (int i = 1; i <= Q; ++i) {
        int q;
        fin >> q;
        int x, y;
        if (!(fout >> x)) {
            WA();
        }
        if (x != -1 && (x < 1 || x > N || t[x] > q)) {
            WA();
        }
        fok >> y;

        if (1LL * (q - t[x]) * v[x] != 1LL * (q - t[y]) * v[y]) {
            WA();
        }
    }

    cout << "1.0" << endl;
    cerr << "translate:success" << endl;

    return 0;
}
