var
    n, m, h, i, ans : longint;
    curA, curB : int64;

begin
    reset(input, 'garden.in');
    rewrite(output, 'garden.out');
    read(n, m, h);
    assert((1 <= n) and (n <= 1e5));
    assert((1 <= m) and (m <= 1e9));
    assert((0 <= h) and (h <= 1e9));
    ans := 0;
    for i := 1 to n do begin
        read(curA, curB);

        assert((0 <= curA) and (curA <= 1e9));
        assert((0 <= curB) and (curB <= 1e9));
        
        curA := curA + curB * int64(m - 1);
        if (curA < h) then begin
            writeln(-1);
            exit;
        end else
        if (curA > h) then begin
            ans := 1;
        end;
    end;
    writeln(ans);
end.
