x = open("garden.in").read().split('\n')
for i in range(len(x)):
    x[i] = list(map(int,x[i].split()))
n,y,h = x[0][0],x[0][1]-1,x[0][2]
x = filter(lambda a: bool(a),x[1:])
ans = 0;
for i in x:
     j = list(map(int,i))
     if (j[0] + j[1]*y < h):
         open("garden.out",'w').write('-1\n')
         exit(0)
     if (j[0] + j[1]*y > h):
         ans = 1
open("garden.out",'w').write(str(ans))
