import java.util.Arrays;
import java.util.Scanner;

public class Main {
	MyScanner sc = new MyScanner();
	Scanner sc2 = new Scanner(System.in);
	final int MOD = 1000000007;
	int[] dx = { 1, 0, 0, -1 };
	int[] dy = { 0, 1, -1, 0 };

	void run() {
		int n = sc.nextInt();
		int s = sc.nextInt();
		int max = -1;
		for (int i = 0; i < n; i++) {
			int x = sc.nextInt();
			int y = sc.nextInt();
			if (s > x) {
				if (y == 0) {
					max = Math.max(max, 0);
				} else {
					max = Math.max(max, 100 - y);
				}
			} else if (s == x) {
				if (y == 0) {
					max = Math.max(max, 0);
				}
			}
		}
		System.out.println(max);
	}

	public static void main(String[] args) {
		new Main().run();
	}

	void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}

	void debug2(int[][] array) {
		for (int i = 0; i < array.length; i++) {
			for (int j = 0; j < array[i].length; j++) {
				System.out.print(array[i][j]);
			}
			System.out.println();
		}
	}

	boolean inner(int h, int w, int limH, int limW) {
		return 0 <= h && h < limH && 0 <= w && w < limW;
	}

	void swap(int[] x, int a, int b) {
		int tmp = x[a];
		x[a] = x[b];
		x[b] = tmp;
	}

	// find minimum i (a[i] >= border)
	int lower_bound(int a[], int border) {
		int l = -1;
		int r = a.length;

		while (r - l > 1) {
			int mid = (l + r) / 2;
			if (border <= a[mid]) {
				r = mid;
			} else {
				l = mid;
			}
		}
		// r = l + 1
		return r;
	}

	boolean palindrome(String s) {
		for (int i = 0; i < s.length() / 2; i++) {
			if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
				return false;
			}
		}
		return true;
	}

	class MyScanner {
		int nextInt() {
			try {
				int c = System.in.read();
				while (c != '-' && (c < '0' || '9' < c))
					c = System.in.read();
				if (c == '-')
					return -nextInt();
				int res = 0;
				do {
					res *= 10;
					res += c - '0';
					c = System.in.read();
				} while ('0' <= c && c <= '9');
				return res;
			} catch (Exception e) {
				return -1;
			}
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		String next() {
			try {
				StringBuilder res = new StringBuilder("");
				int c = System.in.read();
				while (Character.isWhitespace(c))
					c = System.in.read();
				do {
					res.append((char) c);
				} while (!Character.isWhitespace(c = System.in.read()));
				return res.toString();
			} catch (Exception e) {
				return null;
			}
		}

		int[] nextIntArray(int n) {
			int[] in = new int[n];
			for (int i = 0; i < n; i++) {
				in[i] = nextInt();
			}
			return in;
		}

		int[][] nextInt2dArray(int n, int m) {
			int[][] in = new int[n][m];
			for (int i = 0; i < n; i++) {
				in[i] = nextIntArray(m);
			}
			return in;
		}

		double[] nextDoubleArray(int n) {
			double[] in = new double[n];
			for (int i = 0; i < n; i++) {
				in[i] = nextDouble();
			}
			return in;
		}

		long[] nextLongArray(int n) {
			long[] in = new long[n];
			for (int i = 0; i < n; i++) {
				in[i] = nextLong();
			}
			return in;
		}

		char[][] nextCharField(int n, int m) {
			char[][] in = new char[n][m];
			for (int i = 0; i < n; i++) {
				String s = sc.next();
				for (int j = 0; j < m; j++) {
					in[i][j] = s.charAt(j);
				}
			}
			return in;
		}
	}
}


import java.util.Arrays;
import java.util.Scanner;

public class MainC {
	MyScanner sc = new MyScanner();
	Scanner sc2 = new Scanner(System.in);
	final int MOD = 1000000007;
	int[] dx = { 1, -1, -1, 1 };
	int[] dy = { 1, 1, -1, -1 };

	void run() {
		int n = sc.nextInt();
		int s = sc.nextInt();
		int max = -1;
		for (int i = 0; i < n; i++) {
			int x = sc.nextInt();
			int y = sc.nextInt();
			if (x < s) {
				if (y == 0) {
					y = 100;
				}
				max = Math.max(max, 100 - y);
			} else if (x == s) {
				if (y == 0) {
					max = Math.max(max, y);
				}
			}
		}
		System.out.println(max);
	}

	public static void main(String[] args) {
		new MainC().run();
	}

	void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}

	void debug2(long[][] array) {
		for (int i = 0; i < array.length; i++) {
			for (int j = 0; j < array[i].length; j++) {
				System.out.print(array[i][j]);
			}
			System.out.println();
		}
	}

	class MyScanner {
		int nextInt() {
			try {
				int c = System.in.read();
				while (c != '-' && (c < '0' || '9' < c))
					c = System.in.read();
				if (c == '-')
					return -nextInt();
				int res = 0;
				do {
					res *= 10;
					res += c - '0';
					c = System.in.read();
				} while ('0' <= c && c <= '9');
				return res;
			} catch (Exception e) {
				return -1;
			}
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		String next() {
			try {
				StringBuilder res = new StringBuilder("");
				int c = System.in.read();
				while (Character.isWhitespace(c))
					c = System.in.read();
				do {
					res.append((char) c);
				} while (!Character.isWhitespace(c = System.in.read()));
				return res.toString();
			} catch (Exception e) {
				return null;
			}
		}
	}
}


import java.util.Arrays;
import java.util.Scanner;

public class Main {
	MyScanner sc = new MyScanner();
	Scanner sc2 = new Scanner(System.in);
	final int MOD = 1000000007;
	int[] dx = { 1, 0, 0, -1 };
	int[] dy = { 0, 1, -1, 0 };

	void run() {
		int n = sc.nextInt();
		int s = sc.nextInt();
		int max = -1;
		for (int i = 0; i < n; i++) {
			int x = sc.nextInt();
			int y = sc.nextInt();
			if (s > x) {
				max = (y == 0) ? Math.max(max, 0) : Math.max(max, 100 - y);
			} else if (s == x && y == 0) {
				max = Math.max(max, 0);
			}
		}
		System.out.println(max);
	}

	public static void main(String[] args) {
		new Main().run();
	}

	void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}

	void debug2(int[][] array) {
		for (int i = 0; i < array.length; i++) {
			for (int j = 0; j < array[i].length; j++) {
				System.out.print(array[i][j]);
			}
			System.out.println();
		}
	}

	boolean inner(int h, int w, int limH, int limW) {
		return 0 <= h && h < limH && 0 <= w && w < limW;
	}

	void swap(int[] x, int a, int b) {
		int tmp = x[a];
		x[a] = x[b];
		x[b] = tmp;
	}

	// find minimum i (a[i] >= border)
	int lower_bound(int a[], int border) {
		int l = -1;
		int r = a.length;

		while (r - l > 1) {
			int mid = (l + r) / 2;
			if (border <= a[mid]) {
				r = mid;
			} else {
				l = mid;
			}
		}
		// r = l + 1
		return r;
	}

	boolean palindrome(String s) {
		for (int i = 0; i < s.length() / 2; i++) {
			if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
				return false;
			}
		}
		return true;
	}

	class MyScanner {
		int nextInt() {
			try {
				int c = System.in.read();
				while (c != '-' && (c < '0' || '9' < c))
					c = System.in.read();
				if (c == '-')
					return -nextInt();
				int res = 0;
				do {
					res *= 10;
					res += c - '0';
					c = System.in.read();
				} while ('0' <= c && c <= '9');
				return res;
			} catch (Exception e) {
				return -1;
			}
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		String next() {
			try {
				StringBuilder res = new StringBuilder("");
				int c = System.in.read();
				while (Character.isWhitespace(c))
					c = System.in.read();
				do {
					res.append((char) c);
				} while (!Character.isWhitespace(c = System.in.read()));
				return res.toString();
			} catch (Exception e) {
				return null;
			}
		}

		int[] nextIntArray(int n) {
			int[] in = new int[n];
			for (int i = 0; i < n; i++) {
				in[i] = nextInt();
			}
			return in;
		}

		int[][] nextInt2dArray(int n, int m) {
			int[][] in = new int[n][m];
			for (int i = 0; i < n; i++) {
				in[i] = nextIntArray(m);
			}
			return in;
		}

		double[] nextDoubleArray(int n) {
			double[] in = new double[n];
			for (int i = 0; i < n; i++) {
				in[i] = nextDouble();
			}
			return in;
		}

		long[] nextLongArray(int n) {
			long[] in = new long[n];
			for (int i = 0; i < n; i++) {
				in[i] = nextLong();
			}
			return in;
		}

		char[][] nextCharField(int n, int m) {
			char[][] in = new char[n][m];
			for (int i = 0; i < n; i++) {
				String s = sc.next();
				for (int j = 0; j < m; j++) {
					in[i][j] = s.charAt(j);
				}
			}
			return in;
		}
	}
}


import java.util.Arrays;
import java.util.Scanner;

public class Main {
	MyScanner sc = new MyScanner();
	Scanner sc2 = new Scanner(System.in);
	final int MOD = 1000000007;
	int[] dx = { 1, 0, 0, -1 };
	int[] dy = { 0, 1, -1, 0 };

	void run() {
		int n = sc.nextInt();
		int s = sc.nextInt();
		int max = -1;
		for (int i = 0; i < n; i++) {
			int x = sc.nextInt();
			int y = sc.nextInt();
			if (s > x) {
				if (y == 0) {
					max = Math.max(max, 0);
				} else {
					max = Math.max(max, 100 - y);
				}
			}
		}
		System.out.println(max);
	}

	public static void main(String[] args) {
		new Main().run();
	}

	void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}

	void debug2(int[][] array) {
		for (int i = 0; i < array.length; i++) {
			for (int j = 0; j < array[i].length; j++) {
				System.out.print(array[i][j]);
			}
			System.out.println();
		}
	}

	boolean inner(int h, int w, int limH, int limW) {
		return 0 <= h && h < limH && 0 <= w && w < limW;
	}

	void swap(int[] x, int a, int b) {
		int tmp = x[a];
		x[a] = x[b];
		x[b] = tmp;
	}

	// find minimum i (a[i] >= border)
	int lower_bound(int a[], int border) {
		int l = -1;
		int r = a.length;

		while (r - l > 1) {
			int mid = (l + r) / 2;
			if (border <= a[mid]) {
				r = mid;
			} else {
				l = mid;
			}
		}
		// r = l + 1
		return r;
	}

	boolean palindrome(String s) {
		for (int i = 0; i < s.length() / 2; i++) {
			if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
				return false;
			}
		}
		return true;
	}

	class MyScanner {
		int nextInt() {
			try {
				int c = System.in.read();
				while (c != '-' && (c < '0' || '9' < c))
					c = System.in.read();
				if (c == '-')
					return -nextInt();
				int res = 0;
				do {
					res *= 10;
					res += c - '0';
					c = System.in.read();
				} while ('0' <= c && c <= '9');
				return res;
			} catch (Exception e) {
				return -1;
			}
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		String next() {
			try {
				StringBuilder res = new StringBuilder("");
				int c = System.in.read();
				while (Character.isWhitespace(c))
					c = System.in.read();
				do {
					res.append((char) c);
				} while (!Character.isWhitespace(c = System.in.read()));
				return res.toString();
			} catch (Exception e) {
				return null;
			}
		}

		int[] nextIntArray(int n) {
			int[] in = new int[n];
			for (int i = 0; i < n; i++) {
				in[i] = nextInt();
			}
			return in;
		}

		int[][] nextInt2dArray(int n, int m) {
			int[][] in = new int[n][m];
			for (int i = 0; i < n; i++) {
				in[i] = nextIntArray(m);
			}
			return in;
		}

		double[] nextDoubleArray(int n) {
			double[] in = new double[n];
			for (int i = 0; i < n; i++) {
				in[i] = nextDouble();
			}
			return in;
		}

		long[] nextLongArray(int n) {
			long[] in = new long[n];
			for (int i = 0; i < n; i++) {
				in[i] = nextLong();
			}
			return in;
		}

		char[][] nextCharField(int n, int m) {
			char[][] in = new char[n][m];
			for (int i = 0; i < n; i++) {
				String s = sc.next();
				for (int j = 0; j < m; j++) {
					in[i][j] = s.charAt(j);
				}
			}
			return in;
		}
	}
}


import java.util.*;
import java.io.*;

public class CF264A {
	public static void main(String... args) {
		MyScanner sc = new MyScanner();
		int numSugars = sc.nextInt();
		int money = sc.nextInt();
		int maxPossSweetsReturn = -1;
		for (int i = 0; i < numSugars; i++) {
			int sugarDollars = sc.nextInt();
			int sugarCents = sc.nextInt();
			int sweets = 100 - sugarCents;
			if (sugarDollars < money) {
				if (sweets < 100 && sweets > maxPossSweetsReturn) {
					maxPossSweetsReturn = sweets;
				}
			}
		}
		System.out.println(maxPossSweetsReturn);
	}

	public static class MyScanner {
		BufferedReader br;
		StringTokenizer st;
		public MyScanner(Reader in) {
			br = new BufferedReader(in);
		}
		public MyScanner() { this(new InputStreamReader(System.in)); }
		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		int nextInt() { return Integer.parseInt(next()); }
		long nextLong() { return Long.parseLong(next()); }
		double nextDouble() { return Double.parseDouble(next()); }
		// Slightly different from java.util.Scanner.nextLine(),
		// which returns any remaining characters in current line,
		// if any.
		String readNextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}
}


import java.util.*;
import java.io.*;

public class CF264A {
	public static void main(String... args) {
		MyScanner sc = new MyScanner();
		int numSugars = sc.nextInt();
		int money = sc.nextInt();
		int maxPossSweetsReturn = -1;
		for (int i = 0; i < numSugars; i++) {
			int sugarDollars = sc.nextInt();
			int sugarCents = sc.nextInt();
			int sweets = 100 - sugarCents;
			if (sugarDollars * 100 + sugarCents <= money * 100) {
				if (sweets < 100 && sweets > maxPossSweetsReturn) {
					maxPossSweetsReturn = sweets;
				}
			}
		}
		System.out.println(maxPossSweetsReturn);
	}

	public static class MyScanner {
		BufferedReader br;
		StringTokenizer st;
		public MyScanner(Reader in) {
			br = new BufferedReader(in);
		}
		public MyScanner() { this(new InputStreamReader(System.in)); }
		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		int nextInt() { return Integer.parseInt(next()); }
		long nextLong() { return Long.parseLong(next()); }
		double nextDouble() { return Double.parseDouble(next()); }
		// Slightly different from java.util.Scanner.nextLine(),
		// which returns any remaining characters in current line,
		// if any.
		String readNextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}
}


import java.util.*;
import java.io.*;

public class CF264A {
	public static void main(String... args) {
		MyScanner sc = new MyScanner();
		int numSugars = sc.nextInt();
		int money = sc.nextInt();
		int maxPossSweetsReturn = -1;
		for (int i = 0; i < numSugars; i++) {
			int sugarDollars = sc.nextInt();
			int sugarCents = sc.nextInt();
			int sweets = 100 - sugarCents;
			if ((sugarDollars * 100 + sugarCents) <= (money * 100)) {
				if (sweets > maxPossSweetsReturn) {
					if (sweets < 100) {
						maxPossSweetsReturn = sweets;
					} else {
						maxPossSweetsReturn = 0;
					}
				}
			}
		}
		System.out.println(maxPossSweetsReturn);
	}

	public static class MyScanner {
		BufferedReader br;
		StringTokenizer st;
		public MyScanner(Reader in) {
			br = new BufferedReader(in);
		}
		public MyScanner() { this(new InputStreamReader(System.in)); }
		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		int nextInt() { return Integer.parseInt(next()); }
		long nextLong() { return Long.parseLong(next()); }
		double nextDouble() { return Double.parseDouble(next()); }
		// Slightly different from java.util.Scanner.nextLine(),
		// which returns any remaining characters in current line,
		// if any.
		String readNextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}
}


import java.util.*;
import java.io.*;

public class CF264A {
	public static void main(String... args) {
		MyScanner sc = new MyScanner();
		int numSugars = sc.nextInt();
		int money = sc.nextInt();
		int maxPossSweetsReturn = -1;
		for (int i = 0; i < numSugars; i++) {
			int sugarDollars = sc.nextInt();
			int sugarCents = sc.nextInt();
			int sweets = (100 - sugarCents) % 100;
			if ((sugarDollars * 100 + sugarCents) <= (money * 100)) {
				if (sweets < 100 && sweets > maxPossSweetsReturn) {
					maxPossSweetsReturn = sweets;
				}
			}
		}
		System.out.println(maxPossSweetsReturn);
	}

	public static class MyScanner {
		BufferedReader br;
		StringTokenizer st;
		public MyScanner(Reader in) {
			br = new BufferedReader(in);
		}
		public MyScanner() { this(new InputStreamReader(System.in)); }
		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		int nextInt() { return Integer.parseInt(next()); }
		long nextLong() { return Long.parseLong(next()); }
		double nextDouble() { return Double.parseDouble(next()); }
		// Slightly different from java.util.Scanner.nextLine(),
		// which returns any remaining characters in current line,
		// if any.
		String readNextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}
}


import java.util.*;
import java.io.*;

public class CF264A {
	public static void main(String... args) {
		MyScanner sc = new MyScanner();
		int numSugars = sc.nextInt();
		int money = sc.nextInt();
		int maxPossSweetsReturn = -1;
		for (int i = 0; i < numSugars; i++) {
			int sugarDollars = sc.nextInt();
			int sugarCents = sc.nextInt();
			int sweets = 100 - sugarCents;
			if (sugarDollars * 100 + sugarCents < money * 100) {
				if (sweets < 100 && sweets > maxPossSweetsReturn) {
					maxPossSweetsReturn = sweets;
				}
			}
		}
		System.out.println(maxPossSweetsReturn);
	}

	public static class MyScanner {
		BufferedReader br;
		StringTokenizer st;
		public MyScanner(Reader in) {
			br = new BufferedReader(in);
		}
		public MyScanner() { this(new InputStreamReader(System.in)); }
		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		int nextInt() { return Integer.parseInt(next()); }
		long nextLong() { return Long.parseLong(next()); }
		double nextDouble() { return Double.parseDouble(next()); }
		// Slightly different from java.util.Scanner.nextLine(),
		// which returns any remaining characters in current line,
		// if any.
		String readNextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}
}


import java.util.Scanner;

public class CaisaAndSugar {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int s = sc.nextInt();
        int max = -1;
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            if (x <= s && max == -1)
                max = 0;
            int cents = sc.nextInt();
            if (100 - cents > max && x <= s && cents != 0)
                max = 100 - cents;
        }
        System.out.println(max);
    }

}


import java.util.Scanner;

public class CaisaAndSugar {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int s = sc.nextInt();
        int max = -1;
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            int cents = sc.nextInt();
            if (x <= s && max == -1){
                if(x == s){
                    if(cents == 0){
                        max = 0;
                    }
                }
                else max = 0;
            }
            if (100 - cents > max && x <= s && cents != 0){
                if(x != s){
                    max = 100 - cents;
                }
            }
        }
        System.out.println(max);
    }

}


import java.util.Scanner;

public class CaisaAndSugar {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int s = sc.nextInt();
        int max = -1;
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            int cents = sc.nextInt();
            if (x <= s && max == -1){
                if(x == s){
                    if(cents == 0){
                        max = 0;
                    }
                }
                else max = 0;
            }
            if (100 - cents > max && x <= s && cents != 0 && max != -1)
                max = 100 - cents;
        }
        System.out.println(max);
    }

}


import java.util.*;

public class A264
{

	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int s = sc.nextInt();
		A obj[] = new A[n];
		for(int i=0;i<n;i++){
			obj[i]= new A(sc.nextInt(),sc.nextInt());
		}
		int cnt=0;
		int d=s;
		Arrays.sort(obj);
		for(int i=0;i<n;i++){
			if(obj[i].y==0)continue;
			if(d>=obj[i].x){
				cnt+=100-obj[i].y;
				break;

			}
			else{
				cnt=-1;
			}
		}
		pl(""+cnt);

	}

	public static void p(String s)
	{
		System.out.print(s);
	}

	public static void pl(String s)
	{
		System.out.println(s);
	}

	static class A implements Comparable<A>{
		int x;
		int y;
		A(int x,int y){
			this.x=x;
			this.y=y;
		}

		public int compareTo(A a){
			if(this.y>a.y)
				return 1;
			if(this.y<a.y)
				return -1;

			return 0;
		}
	}

}


import java.util.*;

public class A264
{

	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int s = sc.nextInt();
		A obj[] = new A[n];
		for(int i=0;i<n;i++){
			obj[i]= new A(sc.nextInt(),sc.nextInt());
		}
		int cnt=0;
		int d=s;
		Arrays.sort(obj);
		boolean f=true;
		for(int i=0;i<n;i++){
			if(obj[i].y==0){
				if(obj[i].x<=d)
					f=false;
				continue;
			}
			if(d>=obj[i].x){
				cnt+=100-obj[i].y;
				f=false;
				break;

			}

		}
		if(f)
			cnt=-1;
		pl(""+cnt);

	}

	public static void p(String s)
	{
		System.out.print(s);
	}

	public static void pl(String s)
	{
		System.out.println(s);
	}

	static class A implements Comparable<A>{
		int x;
		int y;
		A(int x,int y){
			this.x=x;
			this.y=y;
		}

		public int compareTo(A a){
			if(this.y>a.y)
				return 1;
			if(this.y<a.y)
				return -1;

			return 0;
		}
	}

}


import java.util.*;

public class A264
{

	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int s = sc.nextInt();
		A obj[] = new A[n];
		for(int i=0;i<n;i++){
			obj[i]= new A(sc.nextInt(),sc.nextInt());
		}
		int cnt=0;
		int d=s;
		Arrays.sort(obj);
		boolean f=true;
		for(int i=0;i<n;i++){
			if(obj[i].y==0){
				if(obj[i].x<=d)
					f=false;
				continue;
			}
			if(d==obj[i].x && obj[i].y==0){
				f=false;
				continue;
			}
			if(d>obj[i].x){
				cnt+=100-obj[i].y;
				f=false;
				break;

			}

		}
		if(f)
			cnt=-1;
		pl(""+cnt);

	}

	public static void p(String s)
	{
		System.out.print(s);
	}

	public static void pl(String s)
	{
		System.out.println(s);
	}

	static class A implements Comparable<A>{
		int x;
		int y;
		A(int x,int y){
			this.x=x;
			this.y=y;
		}

		public int compareTo(A a){
			if(this.y>a.y)
				return 1;
			if(this.y<a.y)
				return -1;

			return 0;
		}
	}

}


import java.util.*;

public class A264
{

	public static void main(String args[])
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int s = sc.nextInt();
		A obj[] = new A[n];
		for(int i=0;i<n;i++){
			obj[i]= new A(sc.nextInt(),sc.nextInt());
		}
		int cnt=0;
		int d=s;
		Arrays.sort(obj);
		boolean f=true;
		for(int i=0;i<n;i++){
			if(obj[i].y==0){
				if(obj[i].x<=d)
					f=false;
				continue;
			}
			if(d>=obj[i].x){
				cnt+=100-obj[i].y;
				break;

			}

		}
		if(f)
			cnt=-1;
		pl(""+cnt);

	}

	public static void p(String s)
	{
		System.out.print(s);
	}

	public static void pl(String s)
	{
		System.out.println(s);
	}

	static class A implements Comparable<A>{
		int x;
		int y;
		A(int x,int y){
			this.x=x;
			this.y=y;
		}

		public int compareTo(A a){
			if(this.y>a.y)
				return 1;
			if(this.y<a.y)
				return -1;

			return 0;
		}
	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class TestClass{

        StringTokenizer st = new StringTokenizer("");
        BufferedReader  s = new BufferedReader(new InputStreamReader(System.in));

        public int nextInt() throws IOException{
            if(st.hasMoreTokens())
                return Integer.parseInt(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextInt();
            }
        }

        public double nextDouble() throws IOException{
            if(st.hasMoreTokens())
                return Double.parseDouble(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextDouble();
            }
        }

        public long nextLong() throws IOException{
            if(st.hasMoreTokens())
                return Long.parseLong(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextLong();
            }
        }

        public String nextString() throws IOException{
            if(st.hasMoreTokens())
                return st.nextToken();
            else{
                st = new StringTokenizer(s.readLine());
                return nextString();
            }

        }
        public String readLine() throws IOException{
            return s.readLine();
        }

        public void close() throws IOException{
            s.close();
        }

    PrintWriter ww = new PrintWriter(new OutputStreamWriter(System.out));
    public static void main(String[] args) throws IOException{
        new TestClass().solve();
    }

    void solve() throws IOException{

        int n = nextInt();
        int s = nextInt();
        int ans = -1;
        for(int i=0;i<n;i++){
            int x = nextInt();
            int y = nextInt();
            if(x < s && y != 0){
                if(100-y > ans)
                    ans = 100-y;
            }else if(x <= s && y == 0 && ans == -1)
                ans = 0;

        }
        ww.println(ans);
        ww.close();
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class TestClass{

        StringTokenizer st = new StringTokenizer("");
        BufferedReader  s = new BufferedReader(new InputStreamReader(System.in));

        public int nextInt() throws IOException{
            if(st.hasMoreTokens())
                return Integer.parseInt(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextInt();
            }
        }

        public double nextDouble() throws IOException{
            if(st.hasMoreTokens())
                return Double.parseDouble(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextDouble();
            }
        }

        public long nextLong() throws IOException{
            if(st.hasMoreTokens())
                return Long.parseLong(st.nextToken());
            else{
                st = new StringTokenizer(s.readLine());
                return nextLong();
            }
        }

        public String nextString() throws IOException{
            if(st.hasMoreTokens())
                return st.nextToken();
            else{
                st = new StringTokenizer(s.readLine());
                return nextString();
            }

        }
        public String readLine() throws IOException{
            return s.readLine();
        }

        public void close() throws IOException{
            s.close();
        }

    PrintWriter ww = new PrintWriter(new OutputStreamWriter(System.out));
    public static void main(String[] args) throws IOException{
        new TestClass().solve();
    }

    void solve() throws IOException{

        int n = nextInt();
        int s = nextInt();
        int ans = -1;
        for(int i=0;i<n;i++){
            int x = nextInt();
            int y = nextInt();
            if(x < s && y != 0){
                if(100-y > ans)
                    ans = 100-y;
            }else if(x <= s && y == 0)
                ans = 0;

        }
        ww.println(ans);
        ww.close();
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class TestClass{

		StringTokenizer st = new StringTokenizer("");
		BufferedReader	s = new BufferedReader(new InputStreamReader(System.in));

		public int nextInt() throws IOException{
			if(st.hasMoreTokens())
				return Integer.parseInt(st.nextToken());
			else{
				st = new StringTokenizer(s.readLine());
				return nextInt();
			}
		}

		public double nextDouble() throws IOException{
			if(st.hasMoreTokens())
				return Double.parseDouble(st.nextToken());
			else{
				st = new StringTokenizer(s.readLine());
				return nextDouble();
			}
		}

		public long nextLong() throws IOException{
			if(st.hasMoreTokens())
				return Long.parseLong(st.nextToken());
			else{
				st = new StringTokenizer(s.readLine());
				return nextLong();
			}
		}

		public String nextString() throws IOException{
			if(st.hasMoreTokens())
				return st.nextToken();
			else{
				st = new StringTokenizer(s.readLine());
				return nextString();
			}

		}
		public String readLine() throws IOException{
			return s.readLine();
		}

		public void close() throws IOException{
			s.close();
		}

	PrintWriter ww = new PrintWriter(new OutputStreamWriter(System.out));
	public static void main(String[] args) throws IOException{
		new TestClass().solve();
	}

	void solve() throws IOException{

		int n = nextInt();
		int s = nextInt();
		int ans = -1;
		for(int i=0;i<n;i++){
			int x = nextInt();
			int y = nextInt();
			if(x < s && y != 0)
				if(100-y > ans)
					ans = 100-y;
		}
		ww.println(ans);
		ww.close();
	}
}


import java.util.*;
public class a463
{
    public static void main(String ar[])
    {
        Scanner ob=new Scanner(System.in);
        int n=ob.nextInt();
        int s=ob.nextInt();
        int arr[]=new int[n];
        int arr1[]=new int[s];
        int x=101,y=0;
        for(int i=0;i<n;i++)
        {
            arr[i]=ob.nextInt();
            arr1[i]=ob.nextInt();
            if(arr[i]<s && arr1[i]!=0)
            {
                x=Math.min(x,arr1[i]);
                y=1;
            }
        }
        if(y==1)
            System.out.println(100-x);
        else
            System.out.println("-1");
    }
}


import java.util.*;
public class a463
{
	public static void main(String ar[])
	{
		Scanner ob=new Scanner(System.in);
		int n=ob.nextInt();
		int s=ob.nextInt();
		int a=1000,z=0;
		for(int i=0;i<n;i++)
		{
			int x=ob.nextInt();
			int y=ob.nextInt();
			if(x<=s && y<a && y!=0)
				a=y;
			else if(a==1000 && y==0)
				z=1;
		}
		if(a==1000 && z==1)
			System.out.println(0);
		else if(a==1000)
			System.out.println(-1);
		else
			System.out.println(a);
	}
}


import java.util.*;
public class a463
{
	public static void main(String ar[])
	{
		Scanner ob=new Scanner(System.in);
		int n=ob.nextInt();
		int s=ob.nextInt();
		int a=1000,z=0;
		for(int i=0;i<n;i++)
		{
			int x=ob.nextInt();
			int y=ob.nextInt();
			if(x<=s && y<a && y!=0)
				a=y;
			else if(a==1000 && y==0)
				z=1;
		}
		if(a==1000 && z==1)
			System.out.println(0);
		else if(a==1000)
			System.out.println(-1);
		else
			System.out.println(100-a);
	}
}


import java.util.*;
public class a463
{
	public static void main(String ar[])
	{
		Scanner ob=new Scanner(System.in);
		int n=ob.nextInt();
		int s=ob.nextInt();
		int once=0;
		int cent=Integer.MAX_VALUE;
		for(int i=0;i<n;i++)
		{
			int x=ob.nextInt();
			int y=ob.nextInt();
			if(s>x && cent >y && y!=0)
			{
				cent=y;
				once=1;}
		}
		if(once==1)
			System.out.println(100-cent);
		else
			System.out.println(-1);
	}
}


import java.util.*;
public class a463
{
	public static void main(String ar[])
	{
		Scanner ob=new Scanner(System.in);
		int n=ob.nextInt();
		int s=ob.nextInt();
		int once=0;
		int cent=Integer.MAX_VALUE;
		for(int i=0;i<n;i++)
		{
			int x=ob.nextInt();
			int y=ob.nextInt();
			if(s>x && cent >y && y!=0)
			{
				cent=y;
				once=1;}
			else if(s>=x && y==0 && cent==Integer.MAX_VALUE)
			{
				cent=100;
				once=1;
			}
		}
		if(once==1)
			System.out.println(100-cent);
		else
			System.out.println(-1);
	}
}


import java.util.*;
public class a463
{
	public static void main(String ar[])
	{
		Scanner ob=new Scanner(System.in);
		int n=ob.nextInt();
		int s=ob.nextInt();
		int a=1000;
		for(int i=0;i<n;i++)
		{
			int x=ob.nextInt();
			int y=ob.nextInt();
			if(x<=s && y<a && y!=0)
				a=y;
		}
		if(a==1000)
			System.out.println(-1);
		else
			System.out.println(a);
	}
}


import java.util.*;
public class a463
{
	public static void main(String ar[])
	{
		Scanner ob=new Scanner(System.in);
		int n=ob.nextInt();
		int s=ob.nextInt();
		int ans=-1;
		for(int i=0;i<n;i++)
		{
			int x=ob.nextInt();
			int y=ob.nextInt();
			if(s>=x && y>0)
			{
				if(ans==-1)
				ans=y;
				else if(ans>y)
				ans=y;
			}
			else if(s>=x && y==0 && ans<0)
				ans=y;
		}
		if(ans<=0)
			System.out.println(ans);
		else
		System.out.println(100-ans);
	}
}


import java.io.*;
import java.math.*;
import java.util.*;

public class Main {
    public static void main (String[] args) {
        FastReader in = new FastReader(System.in);

        int n = in.nextInt();
        int s = in.nextInt();

        int c = -1;

        for (int i = 0; i < n; i++) {
            int x = in.nextInt();
            int y = in.nextInt();
            if (x < s && y != 0 && (y < c || c == -1)) {
                c = y;
            }
        }

        System.out.println(c == -1 ? -1 : 100 - c);

    }
}

class FastReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public FastReader(InputStream stream) {
        this.reader = new BufferedReader(new InputStreamReader(stream));
        this.tokenizer = new StringTokenizer("");
    }

    public boolean hasNext() {
        return ensureTokens();
    }

    public String next() {
        return  ensureTokens() ? tokenizer.nextToken() : null;
    }

    private boolean ensureTokens() {
        while(!tokenizer.hasMoreTokens()){
            try{
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (Exception e){
                return false;
            }
        }
        return true;
    }

    public String nextLine() {
        try {
            return reader.readLine();
        } catch (Exception e) {
            return null;
        }
    }

    public char[] nextCharArray() {
        return nextLine().toCharArray();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public int[] nextIntArray(int size) {
        int[] array = new int[size];
        for (int i = 0; i < size; i++) {
            array[i] = nextInt();
        }
        return array;
    }

    public int[] nextIntArrayOnLine() {
        String line = nextLine();
        String[] tokens = line.split(" ");
        int[] array = new int[tokens.length];
        for (int i = 0; i < tokens.length; i++) {
            array[i] = Integer.parseInt(tokens[i]);
        }
        return array;
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public long[] nextLongArray(int size) {
        long[] array = new long[size];
        for (int i = 0; i < size; i++) {
            array[i] = nextLong();
        }
        return array;
    }

    public float nextFloat() {
        return Float.parseFloat(next());
    }

    public float[] nextFloatArray(int size) {
        float[] array = new float[size];
        for (int i = 0; i < size; i++) {
            array[i] = nextFloat();
        }
        return array;
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }

    public double[] nextDoubleArray(int size) {
        double[] array = new double[size];
        for (int i = 0; i < size; i++) {
            array[i] = nextDouble();
        }
        return array;
    }

    public short nextShort() {
        return Short.parseShort(next());
    }

    public short[] nextShortArray(int size) {
        short[] array = new short[size];
        for (int i = 0; i < size; i++) {
            array[i] = nextShort();
        }
        return array;
    }

    public BigDecimal nextBigDecimal() {
        return new BigDecimal(next());
    }

    public BigInteger nextBigInteger() {
        return new BigInteger(next());
    }
}

class FastWriter {
    private final PrintWriter printWriter;

    public FastWriter(OutputStream stream) {
        printWriter = new PrintWriter(new BufferedWriter(new OutputStreamWriter(stream)));
    }

    public FastWriter(Writer writer) {
        printWriter = new PrintWriter(writer);
    }

    public void close() {
        printWriter.close();
    }

    public void print(boolean element) {
        printWriter.print(element);
    }

    public void print(char[] element) {
        printWriter.print(element);
    }

    public void print(double element) {
        printWriter.print(element);
    }

    public void print(float element) {
        printWriter.print(element);
    }

    public void print(int element) {
        printWriter.print(element);
    }

    public void print(long element) {
        printWriter.print(element);
    }

    public void print(String element) {
        printWriter.print(element);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0) {
                printWriter.print(' ');
            }
            printWriter.print(objects[i]);
        }
    }

    public void println(boolean element) {
        printWriter.println(element);
    }

    public void println(char[] element) {
        printWriter.println(element);
    }

    public void println(double element) {
        printWriter.println(element);
    }

    public void println(float element) {
        printWriter.println(element);
    }

    public void println(int element) {
        printWriter.println(element);
    }

    public void println(long element) {
        printWriter.println(element);
    }

    public void println(String element) {
        printWriter.println(element);
    }

    public void println() {
        printWriter.println();
    }

    public void println(Object... objects) {
        print(objects);
        printWriter.println();
    }

    public void printf(String format, Object... args) {
        printWriter.printf(format, args);
    }
}


import java.io.*;
import java.math.*;
import java.util.*;

public class Main {
    public static void main (String[] args) {
        FastReader in = new FastReader(System.in);

        int n = in.nextInt();
        int s = in.nextInt();

        int c = -1;

        for (int i = 0; i < n; i++) {
            int x = in.nextInt();
            int y = in.nextInt();
            if (x < s && y != 0 && (y < c || c == -1)) {
                c = y;
            } else if (x <= s && y == 0 && c == -1) {
                c = 100;
            }
        }

        System.out.println(c == -1 ? -1 : 100 - c);

    }
}

class FastReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public FastReader(InputStream stream) {
        this.reader = new BufferedReader(new InputStreamReader(stream));
        this.tokenizer = new StringTokenizer("");
    }

    public boolean hasNext() {
        return ensureTokens();
    }

    public String next() {
        return  ensureTokens() ? tokenizer.nextToken() : null;
    }

    private boolean ensureTokens() {
        while(!tokenizer.hasMoreTokens()){
            try{
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (Exception e){
                return false;
            }
        }
        return true;
    }

    public String nextLine() {
        try {
            return reader.readLine();
        } catch (Exception e) {
            return null;
        }
    }

    public char[] nextCharArray() {
        return nextLine().toCharArray();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public int[] nextIntArray(int size) {
        int[] array = new int[size];
        for (int i = 0; i < size; i++) {
            array[i] = nextInt();
        }
        return array;
    }

    public int[] nextIntArrayOnLine() {
        String line = nextLine();
        String[] tokens = line.split(" ");
        int[] array = new int[tokens.length];
        for (int i = 0; i < tokens.length; i++) {
            array[i] = Integer.parseInt(tokens[i]);
        }
        return array;
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public long[] nextLongArray(int size) {
        long[] array = new long[size];
        for (int i = 0; i < size; i++) {
            array[i] = nextLong();
        }
        return array;
    }

    public float nextFloat() {
        return Float.parseFloat(next());
    }

    public float[] nextFloatArray(int size) {
        float[] array = new float[size];
        for (int i = 0; i < size; i++) {
            array[i] = nextFloat();
        }
        return array;
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }

    public double[] nextDoubleArray(int size) {
        double[] array = new double[size];
        for (int i = 0; i < size; i++) {
            array[i] = nextDouble();
        }
        return array;
    }

    public short nextShort() {
        return Short.parseShort(next());
    }

    public short[] nextShortArray(int size) {
        short[] array = new short[size];
        for (int i = 0; i < size; i++) {
            array[i] = nextShort();
        }
        return array;
    }

    public BigDecimal nextBigDecimal() {
        return new BigDecimal(next());
    }

    public BigInteger nextBigInteger() {
        return new BigInteger(next());
    }
}

class FastWriter {
    private final PrintWriter printWriter;

    public FastWriter(OutputStream stream) {
        printWriter = new PrintWriter(new BufferedWriter(new OutputStreamWriter(stream)));
    }

    public FastWriter(Writer writer) {
        printWriter = new PrintWriter(writer);
    }

    public void close() {
        printWriter.close();
    }

    public void print(boolean element) {
        printWriter.print(element);
    }

    public void print(char[] element) {
        printWriter.print(element);
    }

    public void print(double element) {
        printWriter.print(element);
    }

    public void print(float element) {
        printWriter.print(element);
    }

    public void print(int element) {
        printWriter.print(element);
    }

    public void print(long element) {
        printWriter.print(element);
    }

    public void print(String element) {
        printWriter.print(element);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0) {
                printWriter.print(' ');
            }
            printWriter.print(objects[i]);
        }
    }

    public void println(boolean element) {
        printWriter.println(element);
    }

    public void println(char[] element) {
        printWriter.println(element);
    }

    public void println(double element) {
        printWriter.println(element);
    }

    public void println(float element) {
        printWriter.println(element);
    }

    public void println(int element) {
        printWriter.println(element);
    }

    public void println(long element) {
        printWriter.println(element);
    }

    public void println(String element) {
        printWriter.println(element);
    }

    public void println() {
        printWriter.println();
    }

    public void println(Object... objects) {
        print(objects);
        printWriter.println();
    }

    public void printf(String format, Object... args) {
        printWriter.printf(format, args);
    }
}


import java.io.*;
import java.math.*;
import java.util.*;

public class Main {
    public static void main (String[] args) {
        FastReader in = new FastReader(System.in);

        int n = in.nextInt();
        int s = in.nextInt();

        int c = -1;

        for (int i = 0; i < n; i++) {
            int x = in.nextInt();
            int y = in.nextInt();
            if (x < s && y != 0 && (y < c || c == -1)) {
                c = y;
            } else if (x == s && y == 0 && c == -1) {
                c = 0;
            }
        }

        System.out.println(c == -1 ? -1 : 100 - c);

    }
}

class FastReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public FastReader(InputStream stream) {
        this.reader = new BufferedReader(new InputStreamReader(stream));
        this.tokenizer = new StringTokenizer("");
    }

    public boolean hasNext() {
        return ensureTokens();
    }

    public String next() {
        return  ensureTokens() ? tokenizer.nextToken() : null;
    }

    private boolean ensureTokens() {
        while(!tokenizer.hasMoreTokens()){
            try{
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (Exception e){
                return false;
            }
        }
        return true;
    }

    public String nextLine() {
        try {
            return reader.readLine();
        } catch (Exception e) {
            return null;
        }
    }

    public char[] nextCharArray() {
        return nextLine().toCharArray();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public int[] nextIntArray(int size) {
        int[] array = new int[size];
        for (int i = 0; i < size; i++) {
            array[i] = nextInt();
        }
        return array;
    }

    public int[] nextIntArrayOnLine() {
        String line = nextLine();
        String[] tokens = line.split(" ");
        int[] array = new int[tokens.length];
        for (int i = 0; i < tokens.length; i++) {
            array[i] = Integer.parseInt(tokens[i]);
        }
        return array;
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public long[] nextLongArray(int size) {
        long[] array = new long[size];
        for (int i = 0; i < size; i++) {
            array[i] = nextLong();
        }
        return array;
    }

    public float nextFloat() {
        return Float.parseFloat(next());
    }

    public float[] nextFloatArray(int size) {
        float[] array = new float[size];
        for (int i = 0; i < size; i++) {
            array[i] = nextFloat();
        }
        return array;
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }

    public double[] nextDoubleArray(int size) {
        double[] array = new double[size];
        for (int i = 0; i < size; i++) {
            array[i] = nextDouble();
        }
        return array;
    }

    public short nextShort() {
        return Short.parseShort(next());
    }

    public short[] nextShortArray(int size) {
        short[] array = new short[size];
        for (int i = 0; i < size; i++) {
            array[i] = nextShort();
        }
        return array;
    }

    public BigDecimal nextBigDecimal() {
        return new BigDecimal(next());
    }

    public BigInteger nextBigInteger() {
        return new BigInteger(next());
    }
}

class FastWriter {
    private final PrintWriter printWriter;

    public FastWriter(OutputStream stream) {
        printWriter = new PrintWriter(new BufferedWriter(new OutputStreamWriter(stream)));
    }

    public FastWriter(Writer writer) {
        printWriter = new PrintWriter(writer);
    }

    public void close() {
        printWriter.close();
    }

    public void print(boolean element) {
        printWriter.print(element);
    }

    public void print(char[] element) {
        printWriter.print(element);
    }

    public void print(double element) {
        printWriter.print(element);
    }

    public void print(float element) {
        printWriter.print(element);
    }

    public void print(int element) {
        printWriter.print(element);
    }

    public void print(long element) {
        printWriter.print(element);
    }

    public void print(String element) {
        printWriter.print(element);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0) {
                printWriter.print(' ');
            }
            printWriter.print(objects[i]);
        }
    }

    public void println(boolean element) {
        printWriter.println(element);
    }

    public void println(char[] element) {
        printWriter.println(element);
    }

    public void println(double element) {
        printWriter.println(element);
    }

    public void println(float element) {
        printWriter.println(element);
    }

    public void println(int element) {
        printWriter.println(element);
    }

    public void println(long element) {
        printWriter.println(element);
    }

    public void println(String element) {
        printWriter.println(element);
    }

    public void println() {
        printWriter.println();
    }

    public void println(Object... objects) {
        print(objects);
        printWriter.println();
    }

    public void printf(String format, Object... args) {
        printWriter.printf(format, args);
    }
}


import java.util.*;
import java.math.*;

public class mayn {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int s = scan.nextInt();
		int max = 0;
		int sweet = 0;
		boolean sugar = false;
		for (int i=0 ; i<n ; i++) {
			int d = scan.nextInt();
			int c = scan.nextInt();
			if (d<s) {
				sugar = true;
				int sg = 100*d + c;
				int mn = 100*s;
				//int mode = sg;
				/*while (mn > mode) {
					sweet = (mn - mode) % 100;
					if (sweet > max) {
						max = sweet;
					}
					mode += sg;
				}*/
				sweet = (mn - sg) % 100;
				if (sweet > max) {
					max = sweet;
				}
			} else if (d==s){
				if (c == 0) {
					sugar = true;
					int sg = 100*d + c;
					int mn = 100*s;
					sweet = (mn - sg) % 100;
					if (sweet > max) {
						max = sweet;
					}
				}
			}
		}
		if (!sugar) {
			System.out.println(-1);
		} else {
			System.out.println(max);
		}
	}
}


import java.util.*;
import java.math.*;

public class mayn {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int s = scan.nextInt();
		int max = 0;
		int sweet = 0;
		boolean sugar = false;
		for (int i=0 ; i<n ; i++) {
			int d = scan.nextInt();
			int c = scan.nextInt();
			if (d<=s) {
				sugar = true;
				int sg = 100*d + c;
				int mn = 100*s;
				int mode = sg;
				while (mn > mode) {
					sweet = (mn - mode) % 100;
					if (sweet > max) {
						max = sweet;
					}
					mode += sg;
				}
			}
		}
		if (!sugar) {
			System.out.println(-1);
		} else {
			System.out.println(max);
		}
	}
}


import java.util.*;
import java.math.*;

public class mayn {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int s = scan.nextInt();
		int max = 0;
		int sweet = 0;
		boolean sugar = false;
		for (int i=0 ; i<n ; i++) {
			int d = scan.nextInt();
			int c = scan.nextInt();
			if (d<=s) {
				sugar = true;
				int sg = 100*d + c;
				int mn = 100*s;
				//int mode = sg;
				/*while (mn > mode) {
					sweet = (mn - mode) % 100;
					if (sweet > max) {
						max = sweet;
					}
					mode += sg;
				}*/
				sweet = (mn - sg) % 100;
				if (sweet > max) {
					max = sweet;
				}
			}
		}
		if (!sugar) {
			System.out.println(-1);
		} else {
			System.out.println(max);
		}
	}
}


package main;

import main.InputReader;
import java.io.PrintWriter;

public class TaskA {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int count = in.nextInt();
        int money = in.nextInt();
        int answer = -1;
        for (int i = 1; i <= count; ++i) {
            int dollars = in.nextInt();
            int cents = in.nextInt();
            if (dollars + (cents > 0 ? 1 : 0) <= money) {
                int candy = 100 - cents;
                if (candy == 100)
                    candy = 0;
                answer = Math.max(answer, candy);
            }
        }
        out.print(answer);
    }
}


import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskA {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int count = in.nextInt();
        int money = in.nextInt();
        int answer = -1;
        for (int i = 1; i <= count; ++i) {
            int dollars = in.nextInt();
            int cents = in.nextInt();
            if (dollars + (cents > 0 ? 1 : 0) <= money) {
                int candy = 100 - cents;
                if (candy == 100)
                    candy = 0;
                answer = Math.max(answer, candy);
            }
        }
        out.print(answer);
    }
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskA {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
    }
}

class InputReader {

    public InputReader(java.io.InputStream stream) { /* compiled code */ }

}


import java.io.InputStreamReader;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.PrintStream;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.Writer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Nipuna Samarasekara
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastScanner in = new FastScanner(inputStream);
		FastPrinter out = new FastPrinter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
    /////////////////////////////////////////////////////////////

    public void solve(int testNumber, FastScanner in, FastPrinter out) {
    int n=in.nextInt(),s=in.nextInt();
        int ans=-1;
        s*=100;
        for (int i = 0; i < n; i++) {
         int k=in.nextInt();
            k*=100;
            k+=in.nextInt();
            int tk=k;
            while (k<=s){
                ans=Math.max(ans,(100-k%100)%100);
                k+=tk;
            }

        }
        out.println(ans);

    }
}

class FastScanner extends BufferedReader {

    public FastScanner(InputStream is) {
        super(new InputStreamReader(is));
    }

    public int read() {
        try {
            int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
            return ret;
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    static boolean isWhiteSpace(int c) {
        return c >= 0 && c <= 32;
    }

    public int nextInt() {
        int c = read();
        while (isWhiteSpace(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int ret = 0;
        while (c >= 0 && !isWhiteSpace(c)) {
            if (c < '0' || c > '9') {
                throw new NumberFormatException("digit expected " + (char) c
                        + " found");
            }
            ret = ret * 10 + c - '0';
            c = read();
        }
        return ret * sgn;
    }

    public String readLine() {
        try {
            return super.readLine();
        } catch (IOException e) {
            return null;
        }
    }

}

class FastPrinter extends PrintWriter {

    public FastPrinter(OutputStream out) {
        super(out);
    }

    public FastPrinter(Writer out) {
        super(out);
    }

}


import java.io.InputStreamReader;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.PrintStream;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.Writer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Nipuna Samarasekara
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastScanner in = new FastScanner(inputStream);
		FastPrinter out = new FastPrinter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
    /////////////////////////////////////////////////////////////

    public void solve(int testNumber, FastScanner in, FastPrinter out) {
    int n=in.nextInt(),s=in.nextInt();
        int ans=-1;
        s*=100;
        for (int i = 0; i < n; i++) {
         int k=in.nextInt();
            k*=100;
            k+=in.nextInt();
            int xx=s/k;
            if (xx>0){
                ans=Math.max(ans,(s-xx*k)%100);
            }

        }
        out.println(ans);

    }
}

class FastScanner extends BufferedReader {

    public FastScanner(InputStream is) {
        super(new InputStreamReader(is));
    }

    public int read() {
        try {
            int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
            return ret;
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    static boolean isWhiteSpace(int c) {
        return c >= 0 && c <= 32;
    }

    public int nextInt() {
        int c = read();
        while (isWhiteSpace(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int ret = 0;
        while (c >= 0 && !isWhiteSpace(c)) {
            if (c < '0' || c > '9') {
                throw new NumberFormatException("digit expected " + (char) c
                        + " found");
            }
            ret = ret * 10 + c - '0';
            c = read();
        }
        return ret * sgn;
    }

    public String readLine() {
        try {
            return super.readLine();
        } catch (IOException e) {
            return null;
        }
    }

}

class FastPrinter extends PrintWriter {

    public FastPrinter(OutputStream out) {
        super(out);
    }

    public FastPrinter(Writer out) {
        super(out);
    }

}


import java.io.InputStreamReader;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.PrintStream;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.Writer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Nipuna Samarasekara
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastScanner in = new FastScanner(inputStream);
		FastPrinter out = new FastPrinter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {
    /////////////////////////////////////////////////////////////

    public void solve(int testNumber, FastScanner in, FastPrinter out) {
    int n=in.nextInt(),s=in.nextInt();
        int ans=-1;
        s*=100;
        for (int i = 0; i < n; i++) {
         int k=in.nextInt();
            k*=100;
            k+=in.nextInt();
            if (k<=s){
                ans=Math.max(ans,(s-k)%100);
            }

        }
        out.println(ans);

    }
}

class FastScanner extends BufferedReader {

    public FastScanner(InputStream is) {
        super(new InputStreamReader(is));
    }

    public int read() {
        try {
            int ret = super.read();
//            if (isEOF && ret < 0) {
//                throw new InputMismatchException();
//            }
//            isEOF = ret == -1;
            return ret;
        } catch (IOException e) {
            throw new InputMismatchException();
        }
    }

    static boolean isWhiteSpace(int c) {
        return c >= 0 && c <= 32;
    }

    public int nextInt() {
        int c = read();
        while (isWhiteSpace(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int ret = 0;
        while (c >= 0 && !isWhiteSpace(c)) {
            if (c < '0' || c > '9') {
                throw new NumberFormatException("digit expected " + (char) c
                        + " found");
            }
            ret = ret * 10 + c - '0';
            c = read();
        }
        return ret * sgn;
    }

    public String readLine() {
        try {
            return super.readLine();
        } catch (IOException e) {
            return null;
        }
    }

}

class FastPrinter extends PrintWriter {

    public FastPrinter(OutputStream out) {
        super(out);
    }

    public FastPrinter(Writer out) {
        super(out);
    }

}


import java.util.*;
import java.math.*;
import java.io.*;
import java.awt.*;
import java.awt.geom.AffineTransform;

public class Main {
    static FastReader in = new FastReader(new BufferedReader(new InputStreamReader(System.in)));
    static PrintWriter out = new PrintWriter(System.out);
    static final int maxn = (int)5e3 + 11;
    static int inf = (1<<30) - 1;
    static int mod = (int)1e9 + 7;
    static int n,m,a,b,ans;
    static int max = -inf;

    public static void main(String[] args) throws Exception {

//        in =  new FastReader(new BufferedReader(new FileReader("input.txt")));
//        out = new PrintWriter("output.txt");
//
        n = in.nextInt();
        m = in.nextInt();

        for (int i=1; i<=n; i++) {
            int l = in.nextInt();
            int r = in.nextInt();
            if (l<=m) {
                if (r==0) continue;
                if (max<100-r) {
                    max = 100-r;
                }
            }
        }

        if (max<0) out.println(-1);
        else out.println(max);
        out.close();
    }

}

class FastReader {

    BufferedReader bf;
    StringTokenizer tk = null;
    String DELIM = " ";

    public FastReader(BufferedReader bf) {
        this.bf = bf;
    }

    public String nextToken() throws Exception {

        if(tk==null || !tk.hasMoreTokens()) {
            tk = new StringTokenizer(bf.readLine(),DELIM);
        }
        return tk.nextToken();
    }

    public int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }
}


import java.util.*;
import java.math.*;
import java.io.*;
import java.awt.*;
import java.awt.geom.AffineTransform;

public class Main {
    static FastReader in = new FastReader(new BufferedReader(new InputStreamReader(System.in)));
    static PrintWriter out = new PrintWriter(System.out);
    static final int maxn = (int)5e3 + 11;
    static int inf = (1<<30) - 1;
    static int mod = (int)1e9 + 7;
    static int n,m,a,b,ans,cnt;
    static int max = -inf;

    public static void main(String[] args) throws Exception {

//        in =  new FastReader(new BufferedReader(new FileReader("input.txt")));
//        out = new PrintWriter("output.txt");
//
        n = in.nextInt();
        m = in.nextInt();

        for (int i=1; i<=n; i++) {
            int l = in.nextInt();
            int r = in.nextInt();
            if (l==m && r>0) continue;

            if (l<=m) {
                cnt++;

                if (r==0) {
                    r = 100;
                }
                if (max<100-r) {
                    max = 100-r;
                }
            }
        }

        if (max<0) {
            if (cnt>0) out.println(0);
            else out.println(-1);
        }
        else out.println(max);
        out.close();
    }

}

class FastReader {

    BufferedReader bf;
    StringTokenizer tk = null;
    String DELIM = " ";

    public FastReader(BufferedReader bf) {
        this.bf = bf;
    }

    public String nextToken() throws Exception {

        if(tk==null || !tk.hasMoreTokens()) {
            tk = new StringTokenizer(bf.readLine(),DELIM);
        }
        return tk.nextToken();
    }

    public int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }
}


import java.util.*;
import java.math.*;
import java.io.*;
import java.awt.*;
import java.awt.geom.AffineTransform;

public class Main {
    static FastReader in = new FastReader(new BufferedReader(new InputStreamReader(System.in)));
    static PrintWriter out = new PrintWriter(System.out);
    static final int maxn = (int)5e3 + 11;
    static int inf = (1<<30) - 1;
    static int mod = (int)1e9 + 7;
    static int n,m,a,b,ans,cnt;
    static int max = -inf;

    public static void main(String[] args) throws Exception {

//        in =  new FastReader(new BufferedReader(new FileReader("input.txt")));
//        out = new PrintWriter("output.txt");
//
        n = in.nextInt();
        m = in.nextInt();

        for (int i=1; i<=n; i++) {
            int l = in.nextInt();
            int r = in.nextInt();
            if (l<m) {
                cnt++;
                if (r==0) continue;
                if (max<100-r) {
                    max = 100-r;
                }
            }
        }

        if (max<0) {
            if (cnt>0) out.println(0);
            else out.println(-1);
        }
        else out.println(max);
        out.close();
    }

}

class FastReader {

    BufferedReader bf;
    StringTokenizer tk = null;
    String DELIM = " ";

    public FastReader(BufferedReader bf) {
        this.bf = bf;
    }

    public String nextToken() throws Exception {

        if(tk==null || !tk.hasMoreTokens()) {
            tk = new StringTokenizer(bf.readLine(),DELIM);
        }
        return tk.nextToken();
    }

    public int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }
}


import java.util.*;
import java.math.*;
import java.io.*;
import java.awt.*;
import java.awt.geom.AffineTransform;

public class Main {
    static FastReader in = new FastReader(new BufferedReader(new InputStreamReader(System.in)));
    static PrintWriter out = new PrintWriter(System.out);
    static final int maxn = (int)5e3 + 11;
    static int inf = (1<<30) - 1;
    static int mod = (int)1e9 + 7;
    static int n,m,a,b,ans;
    static int max = -inf;

    public static void main(String[] args) throws Exception {

//        in =  new FastReader(new BufferedReader(new FileReader("input.txt")));
//        out = new PrintWriter("output.txt");
//
        n = in.nextInt();
        m = in.nextInt();

        for (int i=1; i<=n; i++) {
            int l = in.nextInt();
            int r = in.nextInt();
            if (l<m) {
                if (r==0) continue;
                if (max<100-r) {
                    max = 100-r;
                }
            }
        }

        if (max<0) out.println(-1);
        else out.println(max);
        out.close();
    }

}

class FastReader {

    BufferedReader bf;
    StringTokenizer tk = null;
    String DELIM = " ";

    public FastReader(BufferedReader bf) {
        this.bf = bf;
    }

    public String nextToken() throws Exception {

        if(tk==null || !tk.hasMoreTokens()) {
            tk = new StringTokenizer(bf.readLine(),DELIM);
        }
        return tk.nextToken();
    }

    public int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.StringTokenizer;
import java.util.ArrayList;

public class CF264_A
{
    public static void main(String[] args)
    {
        Scanner in = new Scanner();
        long n = in.nextInt();
        int s = in.nextInt() * 100;
        int max = -1;

        for (int i = 0; i < n; i++)
        {
            int cost_constant = in.nextInt() * 100 + in.nextInt();
            int cost = cost_constant;

            while (cost <= s)
            {
                int sweets = (s - cost) % 100;

                if (sweets > max)
                {
                    max = sweets;
                }

                cost += cost_constant;
            }
        }
        System.out.println(max);
    }

    // -----------Pair class for comparisons--------------
    public static class Pair
        implements Comparable<Pair>
    {
        int x, y;

        public Pair(int x, int y)
        {
            this.x = x;
            this.y = y;
        }

        @Override
        public int compareTo(Pair o)
        {
            return Integer.compare(this.x, o.x);
        }

        @Override
        public int hashCode()
        {
            return x ^ y;
        }

        @Override
        public boolean equals(Object o)
        {
            Pair p = (Pair)o;
            return p.x == x && p.y == y;
        }
    }

    // -----------Scanner class for faster input----------
    /*
     * Provides similar API as java.util.Scanner but does not use regular
     * expression engine.
     */
    public static class Scanner
    {
        BufferedReader  br;
        StringTokenizer st;

        public Scanner(Reader in)
        {
            br = new BufferedReader(in);
        }

        public Scanner()
        {
            this(new InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        // Slightly different from java.util.Scanner.nextLine(),
        // which returns any remaining characters in current line,
        // if any.
        String readNextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
    // --------------------------------------------------------
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.StringTokenizer;
import java.util.ArrayList;

public class CF264_A
{
    public static void main(String[] args)
    {
        Scanner in = new Scanner();
        long n = in.nextInt();
        int s = in.nextInt() * 100;
        int max = -1;

        for (long i = 0; i < n; i++)
        {
            int cost_constant = in.nextInt() * 100 + in.nextInt();
            int cost = cost_constant;

            while (cost <= s)
            {
                int sweets = (s - cost) % 100;

                if (sweets > max)
                {
                    max = sweets;
                }

                cost += cost_constant;
            }
        }
        System.out.println(max);
    }

    // -----------Pair class for comparisons--------------
    public static class Pair
        implements Comparable<Pair>
    {
        int x, y;

        public Pair(int x, int y)
        {
            this.x = x;
            this.y = y;
        }

        @Override
        public int compareTo(Pair o)
        {
            return Integer.compare(this.x, o.x);
        }

        @Override
        public int hashCode()
        {
            return x ^ y;
        }

        @Override
        public boolean equals(Object o)
        {
            Pair p = (Pair)o;
            return p.x == x && p.y == y;
        }
    }

    // -----------Scanner class for faster input----------
    /*
     * Provides similar API as java.util.Scanner but does not use regular
     * expression engine.
     */
    public static class Scanner
    {
        BufferedReader  br;
        StringTokenizer st;

        public Scanner(Reader in)
        {
            br = new BufferedReader(in);
        }

        public Scanner()
        {
            this(new InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        // Slightly different from java.util.Scanner.nextLine(),
        // which returns any remaining characters in current line,
        // if any.
        String readNextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
    // --------------------------------------------------------
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.StringTokenizer;
import java.util.ArrayList;

public class CF264_A
{
    public static void main(String[] args)
    {
        Scanner in = new Scanner();
        long n = in.nextLong();
        int s = in.nextInt() * 100;
        int max = -1;

        for (long i = 0; i < n; i++)
        {
            int cost_constant = in.nextInt() * 100 + in.nextInt();
            int cost = cost_constant;

            int sweets = (s - cost) % 100;

            if (sweets > max) { max = sweets; }
//            while (cost <= s)
//            {
//                int sweets = (s - cost) % 100;
//
//                if (sweets > max)
//                {
//                    max = sweets;
//                }
//
//                cost += cost_constant; // buy another sugar
//            }
        }
        System.out.println(max);
    }

    // -----------Pair class for comparisons--------------
    public static class Pair
        implements Comparable<Pair>
    {
        int x, y;

        public Pair(int x, int y)
        {
            this.x = x;
            this.y = y;
        }

        @Override
        public int compareTo(Pair o)
        {
            return Integer.compare(this.x, o.x);
        }

        @Override
        public int hashCode()
        {
            return x ^ y;
        }

        @Override
        public boolean equals(Object o)
        {
            Pair p = (Pair)o;
            return p.x == x && p.y == y;
        }
    }

    // -----------Scanner class for faster input----------
    /*
     * Provides similar API as java.util.Scanner but does not use regular
     * expression engine.
     */
    public static class Scanner
    {
        BufferedReader  br;
        StringTokenizer st;

        public Scanner(Reader in)
        {
            br = new BufferedReader(in);
        }

        public Scanner()
        {
            this(new InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        // Slightly different from java.util.Scanner.nextLine(),
        // which returns any remaining characters in current line,
        // if any.
        String readNextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
    // --------------------------------------------------------
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.StringTokenizer;
import java.util.ArrayList;

public class CF264_A
{
    public static void main(String[] args)
    {
        Scanner in = new Scanner();
        long n = in.nextInt();
        int s = in.nextInt();
        int max = -1;

        for (int i = 0; i < n; i++)
        {
            int x = in.nextInt();
            int y = in.nextInt();
            double dol = x;
            double cents = y;
            double val = (dol * 100 + cents) / 100;
            double curr = val;

            while (curr <= s)
            {
                int sweets = (int)((100 - (cents % 100)) % 100);

                if (sweets > max)
                {
                    max = sweets;
                }

                curr += val;
                dol += x;
                cents += y;
            }

        }

        System.out.println(max);
    }

    // -----------Pair class for comparisons--------------
    public static class Pair
        implements Comparable<Pair>
    {
        int x, y;

        public Pair(int x, int y)
        {
            this.x = x;
            this.y = y;
        }

        @Override
        public int compareTo(Pair o)
        {
            return Integer.compare(this.x, o.x);
        }

        @Override
        public int hashCode()
        {
            return x ^ y;
        }

        @Override
        public boolean equals(Object o)
        {
            Pair p = (Pair)o;
            return p.x == x && p.y == y;
        }
    }

    // -----------Scanner class for faster input----------
    /*
     * Provides similar API as java.util.Scanner but does not use regular
     * expression engine.
     */
    public static class Scanner
    {
        BufferedReader  br;
        StringTokenizer st;

        public Scanner(Reader in)
        {
            br = new BufferedReader(in);
        }

        public Scanner()
        {
            this(new InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        // Slightly different from java.util.Scanner.nextLine(),
        // which returns any remaining characters in current line,
        // if any.
        String readNextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
    // --------------------------------------------------------
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.StringTokenizer;
import java.util.ArrayList;

public class CF264_A
{
    public static void main(String[] args)
    {
        Scanner in = new Scanner();
        long n = in.nextLong();
        int s = in.nextInt() * 100;
        int max = -1;

        for (long i = 0; i < n; i++)
        {
            int cost = in.nextInt() * 100 + in.nextInt();

            if (s >= cost)
            {
                int sweets = (s - cost) % 100;

                if (sweets > max)
                {
                    max = sweets;
                }
            }
        }
        System.out.println(max);
    }

    // -----------Pair class for comparisons--------------
    public static class Pair
        implements Comparable<Pair>
    {
        int x, y;

        public Pair(int x, int y)
        {
            this.x = x;
            this.y = y;
        }

        @Override
        public int compareTo(Pair o)
        {
            return Integer.compare(this.x, o.x);
        }

        @Override
        public int hashCode()
        {
            return x ^ y;
        }

        @Override
        public boolean equals(Object o)
        {
            Pair p = (Pair)o;
            return p.x == x && p.y == y;
        }
    }

    // -----------Scanner class for faster input----------
    /*
     * Provides similar API as java.util.Scanner but does not use regular
     * expression engine.
     */
    public static class Scanner
    {
        BufferedReader  br;
        StringTokenizer st;

        public Scanner(Reader in)
        {
            br = new BufferedReader(in);
        }

        public Scanner()
        {
            this(new InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        // Slightly different from java.util.Scanner.nextLine(),
        // which returns any remaining characters in current line,
        // if any.
        String readNextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
    // --------------------------------------------------------
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.StringTokenizer;
import java.util.ArrayList;

public class CF264_A
{
    public static void main(String[] args)
    {
        Scanner in = new Scanner();
        long n = in.nextLong();
        int s = in.nextInt() * 100;
        int max = -1;

        for (long i = 0; i < n; i++)
        {
            int cost_constant = in.nextInt() * 100 + in.nextInt();
            int cost = cost_constant;

            while (cost <= s)
            {
                int sweets = (s - cost) % 100;

                if (sweets > max)
                {
                    max = sweets;
                }

                cost += cost_constant; // buy another sugar
            }
        }
        System.out.println(max);
    }

    // -----------Pair class for comparisons--------------
    public static class Pair
        implements Comparable<Pair>
    {
        int x, y;

        public Pair(int x, int y)
        {
            this.x = x;
            this.y = y;
        }

        @Override
        public int compareTo(Pair o)
        {
            return Integer.compare(this.x, o.x);
        }

        @Override
        public int hashCode()
        {
            return x ^ y;
        }

        @Override
        public boolean equals(Object o)
        {
            Pair p = (Pair)o;
            return p.x == x && p.y == y;
        }
    }

    // -----------Scanner class for faster input----------
    /*
     * Provides similar API as java.util.Scanner but does not use regular
     * expression engine.
     */
    public static class Scanner
    {
        BufferedReader  br;
        StringTokenizer st;

        public Scanner(Reader in)
        {
            br = new BufferedReader(in);
        }

        public Scanner()
        {
            this(new InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        // Slightly different from java.util.Scanner.nextLine(),
        // which returns any remaining characters in current line,
        // if any.
        String readNextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
    // --------------------------------------------------------
}


import java.util.*;

public class CF_264_A_CaisaAndSugar {

	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int dollars = in.nextInt();
		ArrayList<Sugar> sugars = new ArrayList<Sugar>();
		Sugar currSugar;

		for (int i = 0; i < n; i++) {
			currSugar = new Sugar(in.nextDouble(), in.nextDouble());
			sugars.add(currSugar);
		}

		Collections.sort(sugars);
		double max = -1;
		double curr;
		double quantity;

		for (Sugar sugar: sugars) {
			if (sugar.dollars < dollars) {
				quantity = (int) Math.floor(dollars/sugar.total);
				if (sugar.cents == 0)
					curr = 0;
				else
					curr = (int) ((100-sugar.cents)*quantity);
				if (curr > max)
					max = curr;
			}
			else if (sugar.dollars == dollars && sugar.cents == 0) {
				if (0 > max)
					max = 0;
			}
		}

		System.out.println((int)max);

	}

	public static class Sugar implements Comparable<Sugar>{
		double dollars;
		double cents;
		double total;

		public Sugar(double d, double c) {
			dollars = d;
			cents = c;
			total = dollars + (cents*0.01);
		}

		public int compareTo(Sugar sugar) {
			if (this.cents < sugar.cents)
				return 1;
			else if(this.cents > sugar.cents)
				return -1;
			return 0;
		}
	}
}


import java.util.*;

public class CF_264_A_CaisaAndSugar {

	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		double n = in.nextDouble();
		double dollars = in.nextDouble();
		ArrayList<Sugar> sugars = new ArrayList<Sugar>();
		Sugar currSugar;

		for (int i = 0; i < n; i++) {
			currSugar = new Sugar(in.nextDouble(), in.nextDouble());
			sugars.add(currSugar);
		}

		Collections.sort(sugars);
		double max = -1;
		double curr;
		double quantity;

		for (Sugar sugar: sugars) {
			if (sugar.dollars < dollars) {
				quantity = (int) Math.floor(dollars/sugar.total);
				if (sugar.cents == 0)
					curr = 0;
				else
					curr = (int) (((100-sugar.cents)*quantity))%100;
				if (curr > max)
					max = curr;
			}
			else if (sugar.dollars == dollars && sugar.cents == 0) {
				if (0 > max)
					max = 0;
			}
		}

		System.out.println((int)max);

	}

	public static class Sugar implements Comparable<Sugar>{
		double dollars;
		double cents;
		double total;

		public Sugar(double d, double c) {
			dollars = d;
			cents = c;
			total = dollars + (cents*0.01);
		}

		public int compareTo(Sugar sugar) {
			if (this.cents < sugar.cents)
				return 1;
			else if(this.cents > sugar.cents)
				return -1;
			return 0;
		}
	}
}


import java.util.*;

public class CF_264_A_CaisaAndSugar {

	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int totalDollars = in.nextInt();
		ArrayList<Sugar> sugars = new ArrayList<Sugar>();
		Sugar currSugar;

		for (int i = 0; i < n; i++) {
			currSugar = new Sugar(in.nextInt(), in.nextInt());
			sugars.add(currSugar);
		}

		int max = -1;
		int curr;

		for (Sugar sugar: sugars) {
			if (sugar.dollars <= totalDollars) {
				if (sugar.dollars < totalDollars && sugar.cents != 0) {
					curr = 100 - sugar.cents;
					max = Math.max(curr, max);
				}
				else if (sugar.cents == 0) {
					max = Math.max(0, max);
				}
			}
		}

		System.out.println(max);

	}

	public static class Sugar {
		int dollars;
		int cents;

		public Sugar(int d, int c) {
			dollars = d;
			cents = c;
		}
	}
}


import java.util.*;

public class CF_264_A_CaisaAndSugar {

	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int dollars = in.nextInt();
		ArrayList<Sugar> sugars = new ArrayList<Sugar>();
		Sugar currSugar;

		for (int i = 0; i < n; i++) {
			currSugar = new Sugar(in.nextInt(), in.nextInt());
			sugars.add(currSugar);
		}

		Collections.sort(sugars);
		int max = -1;
		int curr;
		int quantity;

		for (Sugar sugar: sugars) {
			if (sugar.dollars < dollars) {
				quantity = (int) Math.floor(dollars/sugar.total);
				if (sugar.cents == 0)
					curr = 0;
				else
					curr = (int) ((100-sugar.cents)*quantity);
				if (curr > max)
					max = curr;
			}
			else if (sugar.dollars == dollars && sugar.cents == 0) {
				if (0 > max)
					max = 0;
			}
		}

		System.out.println(max);

	}

	public static class Sugar implements Comparable<Sugar>{
		double dollars;
		double cents;
		double total;

		public Sugar(int d, int c) {
			dollars = d;
			cents = c;
			total = dollars + (cents*0.01);
		}

		public int compareTo(Sugar sugar) {
			if (this.cents < sugar.dollars)
				return 1;
			else if(this.cents > sugar.dollars)
				return -1;
			return 0;
		}
	}
}


import java.util.*;

public class CF_264_A_CaisaAndSugar {

	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int dollars = in.nextInt();
		ArrayList<Sugar> sugars = new ArrayList<Sugar>();
		Sugar currSugar;

		for (int i = 0; i < n; i++) {
			currSugar = new Sugar(in.nextInt(), in.nextInt());
			sugars.add(currSugar);
		}

		Collections.sort(sugars);

		for (Sugar sugar: sugars) {
			if (sugar.dollars < dollars) {
				System.out.println(100-sugar.cents);
				return;
			}
			else if (sugar.dollars == dollars && sugar.cents == 0) {
				System.out.println("0");
				return;
			}
		}

		System.out.println("-1");

	}

	public static class Sugar implements Comparable<Sugar>{
		int dollars;
		int cents;

		public Sugar(int d, int c) {
			dollars = d;
			cents = c;
		}

		public int compareTo(Sugar sugar) {
			if (this.cents < sugar.dollars)
				return 1;
			else if(this.cents > sugar.dollars)
				return -1;
			return 0;
		}
	}
}


import java.util.*;

public class CF_264_A_CaisaAndSugar {

	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int dollars = in.nextInt();
		ArrayList<Sugar> sugars = new ArrayList<Sugar>();
		Sugar currSugar;

		for (int i = 0; i < n; i++) {
			currSugar = new Sugar(in.nextDouble(), in.nextDouble());
			sugars.add(currSugar);
		}

		Collections.sort(sugars);
		double max = -1;
		double curr;
		double quantity;

		for (Sugar sugar: sugars) {
			if (sugar.dollars < dollars) {
				quantity = (int) Math.floor(dollars/sugar.total);
				if (sugar.cents == 0)
					curr = 0;
				else
					curr = (int) ((100-sugar.cents)*quantity);
				if (curr > max)
					max = curr;
			}
			else if (sugar.dollars == dollars && sugar.cents == 0) {
				if (0 > max)
					max = 0;
			}
		}

		System.out.println((int)max);

	}

	public static class Sugar implements Comparable<Sugar>{
		double dollars;
		double cents;
		double total;

		public Sugar(double d, double c) {
			dollars = d;
			cents = c;
			total = dollars + (cents*0.01);
		}

		public int compareTo(Sugar sugar) {
			if (this.cents < sugar.dollars)
				return 1;
			else if(this.cents > sugar.dollars)
				return -1;
			return 0;
		}
	}
}


import java.util.*;

public class CF_264_A_CaisaAndSugar {

	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int dollars = in.nextInt();
		ArrayList<Sugar> sugars = new ArrayList<Sugar>();
		Sugar currSugar;

		for (int i = 0; i < n; i++) {
			currSugar = new Sugar(in.nextInt(), in.nextInt());
			sugars.add(currSugar);
		}

		Collections.sort(sugars);

		for (Sugar sugar: sugars) {
			if (sugar.price < dollars) {
				System.out.println(100-sugar.sweetsChange);
				return;
			}
		}

		System.out.println("-1");

	}

	public static class Sugar implements Comparable<Sugar>{
		int price;
		int sweetsChange;

		public Sugar(int p, int sC) {
			price = p;
			sweetsChange = sC;
		}

		public int compareTo(Sugar sugar) {
			if (this.sweetsChange < sugar.price)
				return 1;
			else if(this.sweetsChange > sugar.price)
				return -1;
			return 0;
		}
	}
}


import java.util.*;

public class CF_264_A_CaisaAndSugar {

	public static void main (String[] args) {
		Scanner in = new Scanner(System.in);
		double n = in.nextDouble();
		double dollars = in.nextDouble();
		ArrayList<Sugar> sugars = new ArrayList<Sugar>();
		Sugar currSugar;

		for (int i = 0; i < n; i++) {
			currSugar = new Sugar(in.nextDouble(), in.nextDouble());
			sugars.add(currSugar);
		}

		Collections.sort(sugars);
		double max = -1;
		double curr;
		double quantity;

		for (Sugar sugar: sugars) {
			if (sugar.dollars < dollars) {
				quantity = (int) Math.floor(dollars/sugar.total);
				if (sugar.cents == 0)
					curr = 0;
				else
					curr = (int) ((100-sugar.cents)*quantity);
				if (curr > max)
					max = curr;
			}
			else if (sugar.dollars == dollars && sugar.cents == 0) {
				if (0 > max)
					max = 0;
			}
		}

		System.out.println((int)max);

	}

	public static class Sugar implements Comparable<Sugar>{
		double dollars;
		double cents;
		double total;

		public Sugar(double d, double c) {
			dollars = d;
			cents = c;
			total = dollars + (cents*0.01);
		}

		public int compareTo(Sugar sugar) {
			if (this.cents < sugar.cents)
				return 1;
			else if(this.cents > sugar.cents)
				return -1;
			return 0;
		}
	}
}