import java.util.Scanner;

public class A {
	public static void main(String[] args) {
		new A().go();
	}

	int n, s, price[];

	public void go() {
		Scanner reader = new Scanner(System.in);
		n = reader.nextInt();
		s = reader.nextInt();
		s *= 100;
		price = new int[n + 1];
		for (int i = 1; i <= n; i++) {
			price[i] = reader.nextInt() * 100 + reader.nextInt();
		}
		reader.close();
		int Max = 0; boolean probable = false;
		for (int i = 1; i <= n; i++) {
			int x = price[i];
			if (x <= s) probable = true;
			else continue;
			if (x%100 != 0) {
				if (100 - x%100 > Max) Max = 100 - x%100;
			}
		}
		if (probable) System.out.print(Max);
		else System.out.print(-1);
	}
}


import java.util.Scanner;

public class A {
	public static void main(String[] args) {
		new A().go();
	}
	int n, s, price[];
	public void go() {
		Scanner reader = new Scanner(System.in);
		n = reader.nextInt();
		s = reader.nextInt();
		s *= 100;
		int Max = 0;
		price = new int[n+1];
		for (int i = 1; i <= n; i++) {
			price[i] = reader.nextInt()*100 + reader.nextInt();
		}
		boolean has = false;
		for (int i = 1; i <= n; i++) {
			if (price[i]%100 == 0) continue;
			int current = price[i];
			while (current < s) {
				has = true;
				if (current%100 != 0) {
					if (((current/100)+1)*100 - current > Max) {
						Max = ((current/100)+1)*100 - current;
					}
				}
				current += price[i];
			}
		}
		if (has) System.out.print(Max);
		else System.out.print(-1);

	}
}


import java.util.Scanner;

public class A {
	public static void main(String[] args) {
		new A().go();
	}
	int n, s, price[];
	public void go() {
		Scanner reader = new Scanner(System.in);
		n = reader.nextInt();
		s = reader.nextInt();
		s *= 100;
		int Max = 0;
		price = new int[n+1];
		for (int i = 1; i <= n; i++) {
			price[i] = reader.nextInt()*100 + reader.nextInt();
		}
		boolean has = false;
		for (int i = 1; i <= n; i++) {
			int current = price[i];
			if (current <= s) has = true;
			while (current < s) {
				if (current%100 != 0) {
					if (((current/100)+1)*100 - current > Max) {
						Max = ((current/100)+1)*100 - current;
					}
				}
				current += price[i];
			}
		}
		if (has) System.out.print(Max);
		else System.out.print(-1);

	}
}


import java.util.Scanner;

public class A {
	public static void main(String[] args) {
		new A().go();
	}

	int n, s, price[];

	public void go() {
		Scanner reader = new Scanner(System.in);
		n = reader.nextInt();
		s = reader.nextInt();
		s *= 100;
		int Max = 0;
		price = new int[n + 1];
		for (int i = 1; i <= n; i++) {
			price[i] = reader.nextInt() * 100 + reader.nextInt();
		}
		boolean has = false;
		loop :
		for (int i = 1; i <= n; i++) {
			int current = price[i];
			if (current <= s) has = true;
			while (true) {
				if (current > s) continue loop;
				if (current%100 != 0) {
					if (100 - current%100 > Max) {
						Max = 100 - current%100;
					}
				}
				current += price[i];
			}
		}
		if (has)
			System.out.print(Max);
		else
			System.out.print(-1);

	}
}


import java.util.Scanner;

public class A {
	public static void main(String[] args) {
		new A().go();
	}

	int n, s, price[];

	public void go() {
		Scanner reader = new Scanner(System.in);
		n = reader.nextInt();
		s = reader.nextInt();
		s *= 100;
		price = new int[n + 1];
		for (int i = 1; i <= n; i++) {
			price[i] = reader.nextInt() * 100 + reader.nextInt();
		}
		reader.close();
		int Max = 0; boolean probable = false;
		for (int i = 1; i <= n; i++) {
			int x = price[i];
			if (x <= s) probable = true;
			else continue;
			while (x <= s) {
				if (x%100 != 0) {
					if (100 - x%100 > Max) {
						Max = 100 - x%100;
					}
				}
				x += price[i];
			}
		}
		if (probable) System.out.print(Max);
		else System.out.print(-1);
	}
}


import java.util.Scanner;

public class A {
	public static void main(String[] args) {
		new A().go();
	}
	int n, s, price[];
	public void go() {
		Scanner reader = new Scanner(System.in);
		n = reader.nextInt();
		s = reader.nextInt();
		s *= 100;
		int Max = 0;
		price = new int[n+1];
		for (int i = 1; i <= n; i++) {
			price[i] = reader.nextInt()*100 + reader.nextInt();
		}
		boolean has = false;
		for (int i  = 1; i <= n; i++) {
			if (price[i]%100 == 0) continue;
			int current = price[i];
			while (current < s) {
				has = true;
				if (((current/100)+1)*100 - current > Max) {
					Max = ((current/100)+1)*100 - current;
				}
				current += price[i];
			}
		}
		if (has) System.out.print(Max);
		else System.out.print(-1);

	}
}


import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.lang.*;
import java.util.*;
import java.math.*;
import java.util.Collections;
import java.util.Comparator;
import java.util.StringTokenizer;
import java.lang.String;

public class Solution {

    public static void main(String[] args) {
        new Solution().myRun();
    }

    FastInputScanner in;
    PrintWriter out;

    void solveTask() {
        int n = in.nextInt();
        int s = in.nextInt();
        int answer = -1;
        for (int i = 0; i < n; ++i) {
            int a = in.nextInt();
            int b = in.nextInt();
            if (a < s) {
                if (100 - b > answer && b != 0) {
                    answer = 100 - b;
                }
                if (b == 0) {
                    answer = Math.max(answer, 0);
                }
            }
            if (a == s && b == 0) {
                answer = Math.max(answer, 0);
            }
        }
        out.println(answer);
    }

    void myRun() {
        in = new FastInputScanner(System.in);
        out = new PrintWriter(new OutputStreamWriter(System.out));
        solveTask();
        out.close();
    }

    void myRunIO(){
        try  {
            in = new FastInputScanner(new File("input.txt"));
            out = new PrintWriter(new FileWriter(new File("output.txt")));
            solveTask();
            out.close();
        } catch(Exception exception){
            exception.printStackTrace();
        }
    }

    class FastInputScanner{

        BufferedReader bufferedReader;
        StringTokenizer stringTokenizer;

        public FastInputScanner(File file){
            try{
                bufferedReader = new BufferedReader(new FileReader(file));
            }
            catch(IOException exception){
                exception.printStackTrace();
            }
        }

        public FastInputScanner(InputStream inputStream){
            bufferedReader = new BufferedReader(new InputStreamReader(inputStream), 32768);
        }

        String next(){
            while(stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
                try {
                    stringTokenizer = new StringTokenizer(bufferedReader.readLine());
                }
                catch(IOException exception) {
                    exception.printStackTrace();
                }
            }
            return stringTokenizer.nextToken();
        }

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

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

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

        String nextLine(){
            try {
                return bufferedReader.readLine();
            }
            catch(Exception exception) {
                exception.printStackTrace();
            }
            return "";
        }

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

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

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

        int[] nextIntArray(int n) {
            int a[] = new int[n];
            for(int i = 0; i < n; i++)
                a[i] = Integer.parseInt(next());
            return a;
        }

        long[] nextLongArray(int n){
            long a[] = new long[n];
            for(int i = 0; i < n; i++)
                a[i] = Long.parseLong(next());
            return a;
        }

    }

}


import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.lang.*;
import java.util.*;
import java.math.*;
import java.util.Collections;
import java.util.Comparator;
import java.util.StringTokenizer;
import java.lang.String;

public class Solution {

    public static void main(String[] args) {
        new Solution().myRun();
    }

    FastInputScanner in;
    PrintWriter out;

    void solveTask() {
        int n = in.nextInt();
        int s = in.nextInt();
        int answer = -1;
        for (int i = 0; i < n; ++i) {
            int a = in.nextInt();
            int b = in.nextInt();
            if (a < s) {
                if (100 - b > answer && b != 0) {
                    answer = 100 - b;
                }
            }
        }
        out.println(answer);
    }

    void myRun() {
        in = new FastInputScanner(System.in);
        out = new PrintWriter(new OutputStreamWriter(System.out));
        solveTask();
        out.close();
    }

    void myRunIO(){
        try  {
            in = new FastInputScanner(new File("input.txt"));
            out = new PrintWriter(new FileWriter(new File("output.txt")));
            solveTask();
            out.close();
        } catch(Exception exception){
            exception.printStackTrace();
        }
    }

    class FastInputScanner{

        BufferedReader bufferedReader;
        StringTokenizer stringTokenizer;

        public FastInputScanner(File file){
            try{
                bufferedReader = new BufferedReader(new FileReader(file));
            }
            catch(IOException exception){
                exception.printStackTrace();
            }
        }

        public FastInputScanner(InputStream inputStream){
            bufferedReader = new BufferedReader(new InputStreamReader(inputStream), 32768);
        }

        String next(){
            while(stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
                try {
                    stringTokenizer = new StringTokenizer(bufferedReader.readLine());
                }
                catch(IOException exception) {
                    exception.printStackTrace();
                }
            }
            return stringTokenizer.nextToken();
        }

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

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

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

        String nextLine(){
            try {
                return bufferedReader.readLine();
            }
            catch(Exception exception) {
                exception.printStackTrace();
            }
            return "";
        }

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

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

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

        int[] nextIntArray(int n) {
            int a[] = new int[n];
            for(int i = 0; i < n; i++)
                a[i] = Integer.parseInt(next());
            return a;
        }

        long[] nextLongArray(int n){
            long a[] = new long[n];
            for(int i = 0; i < n; i++)
                a[i] = Long.parseLong(next());
            return a;
        }

    }

}


import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.lang.*;
import java.util.*;
import java.math.*;
import java.util.Collections;
import java.util.Comparator;
import java.util.StringTokenizer;
import java.lang.String;

public class Solution {

    public static void main(String[] args) {
        new Solution().myRun();
    }

    FastInputScanner in;
    PrintWriter out;

    void solveTask() {
        int n = in.nextInt();
        int s = in.nextInt();
        int answer = -1;
        for (int i = 0; i < n; ++i) {
            int a = in.nextInt();
            int b = in.nextInt();
            if (a < s) {
                if (100 - s > answer) {
                    answer = 100 - s;
                }
            }
        }
        out.println(answer);
    }

    void myRun() {
        in = new FastInputScanner(System.in);
        out = new PrintWriter(new OutputStreamWriter(System.out));
        solveTask();
        out.close();
    }

    void myRunIO(){
        try  {
            in = new FastInputScanner(new File("input.txt"));
            out = new PrintWriter(new FileWriter(new File("output.txt")));
            solveTask();
            out.close();
        } catch(Exception exception){
            exception.printStackTrace();
        }
    }

    class FastInputScanner{

        BufferedReader bufferedReader;
        StringTokenizer stringTokenizer;

        public FastInputScanner(File file){
            try{
                bufferedReader = new BufferedReader(new FileReader(file));
            }
            catch(IOException exception){
                exception.printStackTrace();
            }
        }

        public FastInputScanner(InputStream inputStream){
            bufferedReader = new BufferedReader(new InputStreamReader(inputStream), 32768);
        }

        String next(){
            while(stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
                try {
                    stringTokenizer = new StringTokenizer(bufferedReader.readLine());
                }
                catch(IOException exception) {
                    exception.printStackTrace();
                }
            }
            return stringTokenizer.nextToken();
        }

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

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

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

        String nextLine(){
            try {
                return bufferedReader.readLine();
            }
            catch(Exception exception) {
                exception.printStackTrace();
            }
            return "";
        }

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

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

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

        int[] nextIntArray(int n) {
            int a[] = new int[n];
            for(int i = 0; i < n; i++)
                a[i] = Integer.parseInt(next());
            return a;
        }

        long[] nextLongArray(int n){
            long a[] = new long[n];
            for(int i = 0; i < n; i++)
                a[i] = Long.parseLong(next());
            return a;
        }

    }

}


import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.lang.*;
import java.util.*;
import java.math.*;
import java.util.Collections;
import java.util.Comparator;
import java.util.StringTokenizer;
import java.lang.String;

public class Solution {

    public static void main(String[] args) {
        new Solution().myRun();
    }

    FastInputScanner in;
    PrintWriter out;

    void solveTask() {
        int n = in.nextInt();
        int s = in.nextInt();
        int answer = -1;
        for (int i = 0; i < n; ++i) {
            int a = in.nextInt();
            int b = in.nextInt();
            if (a < s) {
                if (100 - b > answer) {
                    answer = 100 - b;
                }
            }
        }
        out.println(answer);
    }

    void myRun() {
        in = new FastInputScanner(System.in);
        out = new PrintWriter(new OutputStreamWriter(System.out));
        solveTask();
        out.close();
    }

    void myRunIO(){
        try  {
            in = new FastInputScanner(new File("input.txt"));
            out = new PrintWriter(new FileWriter(new File("output.txt")));
            solveTask();
            out.close();
        } catch(Exception exception){
            exception.printStackTrace();
        }
    }

    class FastInputScanner{

        BufferedReader bufferedReader;
        StringTokenizer stringTokenizer;

        public FastInputScanner(File file){
            try{
                bufferedReader = new BufferedReader(new FileReader(file));
            }
            catch(IOException exception){
                exception.printStackTrace();
            }
        }

        public FastInputScanner(InputStream inputStream){
            bufferedReader = new BufferedReader(new InputStreamReader(inputStream), 32768);
        }

        String next(){
            while(stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
                try {
                    stringTokenizer = new StringTokenizer(bufferedReader.readLine());
                }
                catch(IOException exception) {
                    exception.printStackTrace();
                }
            }
            return stringTokenizer.nextToken();
        }

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

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

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

        String nextLine(){
            try {
                return bufferedReader.readLine();
            }
            catch(Exception exception) {
                exception.printStackTrace();
            }
            return "";
        }

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

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

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

        int[] nextIntArray(int n) {
            int a[] = new int[n];
            for(int i = 0; i < n; i++)
                a[i] = Integer.parseInt(next());
            return a;
        }

        long[] nextLongArray(int n){
            long a[] = new long[n];
            for(int i = 0; i < n; i++)
                a[i] = Long.parseLong(next());
            return a;
        }

    }

}


import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.lang.*;
import java.util.*;
import java.math.*;
import java.util.Collections;
import java.util.Comparator;
import java.util.StringTokenizer;
import java.lang.String;

public class Solution {

    public static void main(String[] args) {
        new Solution().myRun();
    }

    FastInputScanner in;
    PrintWriter out;

    void solveTask() {
        int n = in.nextInt();
        int s = in.nextInt();
        int answer = -1;
        for (int i = 0; i < n; ++i) {
            int a = in.nextInt();
            int b = in.nextInt();
            if (a < s) {
                if (100 - b > answer && b != 0) {
                    answer = 100 - b;
                }
                if (b == 0) {
                    answer = Math.max(answer, 0);
                }
            }
        }
        out.println(answer);
    }

    void myRun() {
        in = new FastInputScanner(System.in);
        out = new PrintWriter(new OutputStreamWriter(System.out));
        solveTask();
        out.close();
    }

    void myRunIO(){
        try  {
            in = new FastInputScanner(new File("input.txt"));
            out = new PrintWriter(new FileWriter(new File("output.txt")));
            solveTask();
            out.close();
        } catch(Exception exception){
            exception.printStackTrace();
        }
    }

    class FastInputScanner{

        BufferedReader bufferedReader;
        StringTokenizer stringTokenizer;

        public FastInputScanner(File file){
            try{
                bufferedReader = new BufferedReader(new FileReader(file));
            }
            catch(IOException exception){
                exception.printStackTrace();
            }
        }

        public FastInputScanner(InputStream inputStream){
            bufferedReader = new BufferedReader(new InputStreamReader(inputStream), 32768);
        }

        String next(){
            while(stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
                try {
                    stringTokenizer = new StringTokenizer(bufferedReader.readLine());
                }
                catch(IOException exception) {
                    exception.printStackTrace();
                }
            }
            return stringTokenizer.nextToken();
        }

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

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

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

        String nextLine(){
            try {
                return bufferedReader.readLine();
            }
            catch(Exception exception) {
                exception.printStackTrace();
            }
            return "";
        }

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

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

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

        int[] nextIntArray(int n) {
            int a[] = new int[n];
            for(int i = 0; i < n; i++)
                a[i] = Integer.parseInt(next());
            return a;
        }

        long[] nextLongArray(int n){
            long a[] = new long[n];
            for(int i = 0; i < n; i++)
                a[i] = Long.parseLong(next());
            return a;
        }

    }

}


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

public class CaisaAndSugar {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());

        int n = Integer.parseInt(st.nextToken());
        int s = Integer.parseInt(st.nextToken());
        ArrayList<Integer> a = new ArrayList();
        ArrayList<Integer> b = new ArrayList();
        for (int i = 0; i < n; i++) {
            st = new StringTokenizer(br.readLine());
            int x = Integer.parseInt(st.nextToken());
            int y = Integer.parseInt(st.nextToken());
            if (x < s) {
                    a.add(y);
            }
        }
        if (a.isEmpty()) {
            System.out.println("-1");
        } else {
            Collections.sort(a);
            for (int i = 0; i < a.size(); i++) {
                if(a.get(i)==0){
                    b.add(a.get(i));
                    a.remove(i);
                }
            }
            if(a.isEmpty()){
                System.out.println("0");
            }
            else{
            System.out.println(100 - a.get(0));
        }
    }
}
}


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

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());

        int n = Integer.parseInt(st.nextToken());
        int s = Integer.parseInt(st.nextToken());
        ArrayList<Integer> a = new ArrayList();
        ArrayList<Integer> b = new ArrayList();
        ArrayList<Integer>c = new ArrayList();
        for (int i = 0; i < n; i++) {
            st = new StringTokenizer(br.readLine());
            int x = Integer.parseInt(st.nextToken());
            int y = Integer.parseInt(st.nextToken());
            if ((x ==s&&y==0)||x<s) {
                    a.add(y);
            }
        }
        if (a.isEmpty()) {
            System.out.println("-1");
        } else {
            Collections.sort(a);
            for (int i = 0; i < a.size(); i++) {
                int x=a.get(i);
                if(x==0){
                    b.add(x);
                }
                else{
                    c.add(x);
                }
            }
            if(b.size()==a.size()){
                System.out.println("0");
            }
            else{
                Collections.sort(c);
            System.out.println(100 - c.get(0));
        }
    }
}
}


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

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());

        int n = Integer.parseInt(st.nextToken());
        int s = Integer.parseInt(st.nextToken());
        ArrayList<Integer> a = new ArrayList();
        ArrayList<Integer> b = new ArrayList();
        ArrayList<Integer>c = new ArrayList();
        for (int i = 0; i < n; i++) {
            st = new StringTokenizer(br.readLine());
            int x = Integer.parseInt(st.nextToken());
            int y = Integer.parseInt(st.nextToken());
            if (x <= s&&y==0) {
                    a.add(y);
            }
        }
        if (a.isEmpty()) {
            System.out.println("-1");
        } else {
            Collections.sort(a);
            for (int i = 0; i < a.size(); i++) {
                int x=a.get(i);
                if(x==0){
                    b.add(x);
                }
                else{
                    c.add(x);
                }
            }
            if(b.size()==a.size()){
                System.out.println("0");
            }
            else{
                Collections.sort(c);
            System.out.println(100 - c.get(0));
        }
    }
}
}


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

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());

        int n = Integer.parseInt(st.nextToken());
        int s = Integer.parseInt(st.nextToken());
        ArrayList<Integer> a = new ArrayList();
        for (int i = 0; i < n; i++) {
            st = new StringTokenizer(br.readLine());
            int x = Integer.parseInt(st.nextToken());
            int y = Integer.parseInt(st.nextToken());
            if (x <= s) {
                if (y != 0) {
                    a.add(y);
                }
            }
        }
        if (a.isEmpty()) {
            System.out.println("-1");
        } else {
            Collections.sort(a);
            System.out.println(100 - a.get(0));
        }
    }
}


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

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());

        int n = Integer.parseInt(st.nextToken());
        int s = Integer.parseInt(st.nextToken());
        ArrayList<Integer> a = new ArrayList();
        ArrayList<Integer> b = new ArrayList();
        for (int i = 0; i < n; i++) {
            st = new StringTokenizer(br.readLine());
            int x = Integer.parseInt(st.nextToken());
            int y = Integer.parseInt(st.nextToken());
            if (x <= s) {
                    a.add(y);
            }
        }
        if (a.isEmpty()) {
            System.out.println("-1");
        } else {
            Collections.sort(a);
            for (int i = 0; i < a.size(); i++) {
                if(a.get(i)==0){
                    b.add(a.get(i));
                    a.remove(i);
                }
            }
            if(a.isEmpty()){
                System.out.println("0");
            }
            else{
            System.out.println(100 - a.get(0));
        }
    }
}
}


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

public class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());

        int n = Integer.parseInt(st.nextToken());
        int s = Integer.parseInt(st.nextToken());
        ArrayList<Integer> a = new ArrayList();
        ArrayList<Integer> b = new ArrayList();
        ArrayList<Integer>c = new ArrayList();
        for (int i = 0; i < n; i++) {
            st = new StringTokenizer(br.readLine());
            int x = Integer.parseInt(st.nextToken());
            int y = Integer.parseInt(st.nextToken());
            if (x < s) {
                    a.add(y);
            }
        }
        if (a.isEmpty()) {
            System.out.println("-1");
        } else {
            Collections.sort(a);
            for (int i = 0; i < a.size(); i++) {
                int x=a.get(i);
                if(x==0){
                    b.add(x);
                }
                else{
                    c.add(x);
                }
            }
            if(b.size()==a.size()){
                System.out.println("0");
            }
            else{
                Collections.sort(c);
            System.out.println(100 - c.get(0));
        }
    }
}
}


import java.io.*;
import java.util.*;
public class Main {

    public static void main(String[] args)
    {
        InputStream inputstream = System.in;
        OutputStream outputstream = System.out;
        InputReader in = new InputReader(inputstream);
        OutputWriter out = new OutputWriter(outputstream);
        mysolver mysol = new mysolver();
        mysol.solve(in, out);
        out.close();
    }

}

class mysolver {
    public void solve(InputReader in,OutputWriter out)
    {
    	PrintWriter pout = new PrintWriter(new BufferedOutputStream(System.out));
    	int n = in.readInt();
    	int s = in.readInt();
    	int maxi = -1;
    	for(int i=0;i<n;i++)
    	{
    		int x = in.readInt();
    		int y = in.readInt();
    		if(x < s)
    		{
    			maxi = Math.max(maxi,0);
    			if(100-y > maxi && y > 0)
    			{
    				maxi = 100-y;
    			}
    		}
    		else if(x==s && y==0)
    		{
    			maxi = Math.max(maxi, 0);
    		}
    	}
    	pout.println(maxi);
    	pout.close();
    }

}
class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public String next() {
        return readString();
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

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

    public void printLine(int i) {
        writer.println(i);
    }
}

class IOUtils {

    public static void readIntArrays(InputReader in, int[]... arrays) {
        for (int i = 0; i < arrays[0].length; i++) {
            for (int j = 0; j < arrays.length; j++)
                arrays[j][i] = in.readInt();
        }
    }

    }


import java.io.*;
import java.util.*;
public class Main {

    public static void main(String[] args)
    {
        InputStream inputstream = System.in;
        OutputStream outputstream = System.out;
        InputReader in = new InputReader(inputstream);
        OutputWriter out = new OutputWriter(outputstream);
        mysolver mysol = new mysolver();
        mysol.solve(in, out);
        out.close();
    }

}

class mysolver {
    public void solve(InputReader in,OutputWriter out)
    {
    	PrintWriter pout = new PrintWriter(new BufferedOutputStream(System.out));
    	int n = in.readInt();
    	int s = in.readInt();
    	int maxi = -1;
    	for(int i=0;i<n;i++)
    	{
    		int x = in.readInt();
    		int y = in.readInt();
    		if(x < s && y > maxi && y >0)
    		{
    			maxi = 100-y;
    		}
    	}
    	pout.println(maxi);
    	pout.close();
    }

}
class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public String next() {
        return readString();
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

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

    public void printLine(int i) {
        writer.println(i);
    }
}

class IOUtils {

    public static void readIntArrays(InputReader in, int[]... arrays) {
        for (int i = 0; i < arrays[0].length; i++) {
            for (int j = 0; j < arrays.length; j++)
                arrays[j][i] = in.readInt();
        }
    }

    }


import java.io.*;
import java.util.*;
public class Main {

    public static void main(String[] args)
    {
        InputStream inputstream = System.in;
        OutputStream outputstream = System.out;
        InputReader in = new InputReader(inputstream);
        OutputWriter out = new OutputWriter(outputstream);
        mysolver mysol = new mysolver();
        mysol.solve(in, out);
        out.close();
    }

}

class mysolver {
    public void solve(InputReader in,OutputWriter out)
    {
    	PrintWriter pout = new PrintWriter(new BufferedOutputStream(System.out));
    	int n = in.readInt();
    	int s = in.readInt();
    	int maxi = -1;
    	for(int i=0;i<n;i++)
    	{
    		int x = in.readInt();
    		int y = in.readInt();
    		if(x < s)
    		{
    			maxi = Math.max(maxi,0);
    			if(100-y > maxi && y > 0)
    			{
    				maxi = 100-y;
    			}
    		}
    	}
    	pout.println(maxi);
    	pout.close();
    }

}
class InputReader {

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (numChars == -1)
            throw new InputMismatchException();
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int readInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public String next() {
        return readString();
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

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

    public void printLine(int i) {
        writer.println(i);
    }
}

class IOUtils {

    public static void readIntArrays(InputReader in, int[]... arrays) {
        for (int i = 0; i < arrays[0].length; i++) {
            for (int j = 0; j < arrays.length; j++)
                arrays[j][i] = in.readInt();
        }
    }

    }


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;

public class Main {

	public static void main(String[] args) {
		TaskA mSol = new TaskA();
		mSol.solve();
		mSol.flush();
		mSol.close();
	}

}

class TaskA {

	public FasterScanner mFScanner;
	public PrintWriter mOut;

	public TaskA() {
		mFScanner = new FasterScanner();
		mOut = new PrintWriter(System.out);
	}

	public void solve() {
		int n, numDollars;
		int[] dollars;
		int[] cents;
		int max = -1;

		n = mFScanner.nextInt();
		numDollars = mFScanner.nextInt();

		dollars = new int[n];
		cents = new int[n];

		for (int i = 0; i < n; i++) {
			dollars[i] = mFScanner.nextInt();
			cents[i] = mFScanner.nextInt();

			if (numDollars > dollars[i]) {
				if (cents[i] == 0)
					max = Math.max(max, 0);
				else
					max = Math.max(max, 100 - cents[i]);
			}
		}

		mOut.println(max);

	}

	public void flush() {
		mOut.flush();
	}

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

class FasterScanner {
	private InputStream mIs;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;

	public FasterScanner() {
		this(System.in);
	}

	public FasterScanner(InputStream is) {
		mIs = is;
	}

	public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = mIs.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public String nextLine() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isEndOfLine(c));
		return res.toString();
	}

	public String nextString() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	public long nextLong() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public int nextInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public boolean isSpaceChar(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	public boolean isEndOfLine(int c) {
		return c == '\n' || c == '\r' || c == -1;
	}

}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;

public class Main {

	public static void main(String[] args) {
		TaskA mSol = new TaskA();
		mSol.solve();
		mSol.flush();
		mSol.close();
	}

}

class TaskA {

	public FasterScanner mFScanner;
	public PrintWriter mOut;

	public TaskA() {
		mFScanner = new FasterScanner();
		mOut = new PrintWriter(System.out);
	}

	public void solve() {
		int n, numDollars;
		int[] dollars;
		int[] cents;
		int max = -1;

		n = mFScanner.nextInt();
		numDollars = mFScanner.nextInt();

		dollars = new int[n];
		cents = new int[n];

		for (int i = 0; i < n; i++) {
			dollars[i] = mFScanner.nextInt();
			cents[i] = mFScanner.nextInt();
			dollars[i] = dollars[i] * 100 + cents[i];
			numDollars *= 100;

			if (numDollars >= dollars[i]) {
				if (cents[i] == 0)
					max = Math.max(max, 0);
				else
					max = Math.max(max, 100 - cents[i]);
			}
		}

		mOut.println(max);

	}

	public void flush() {
		mOut.flush();
	}

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

class FasterScanner {
	private InputStream mIs;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;

	public FasterScanner() {
		this(System.in);
	}

	public FasterScanner(InputStream is) {
		mIs = is;
	}

	public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = mIs.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public String nextLine() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isEndOfLine(c));
		return res.toString();
	}

	public String nextString() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	public long nextLong() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public int nextInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public boolean isSpaceChar(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	public boolean isEndOfLine(int c) {
		return c == '\n' || c == '\r' || c == -1;
	}

}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;

public class Main {

	public static void main(String[] args) {
		TaskA mSol = new TaskA();
		mSol.solve();
		mSol.flush();
		mSol.close();
	}

}

class TaskA {

	public FasterScanner mFScanner;
	public PrintWriter mOut;

	public TaskA() {
		mFScanner = new FasterScanner();
		mOut = new PrintWriter(System.out);
	}

	public void solve() {
		int n, numDollars;
		int [] dollars;
		int [] cents;
		int max = -1;

		n = mFScanner.nextInt();
		numDollars = mFScanner.nextInt();

		dollars = new int[n];
		cents = new int[n];

		for (int i = 0; i < n; i++) {
			dollars[i] = mFScanner.nextInt();
			cents[i] = mFScanner.nextInt();

			if (numDollars > dollars[i] && cents[i] != 0) {
				max = Math.max(max, 100 - cents[i]);
			}
		}

		mOut.println(max);

	}

	public void flush() {
		mOut.flush();
	}

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

class FasterScanner {
	private InputStream mIs;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;

	public FasterScanner() {
		this(System.in);
	}

	public FasterScanner(InputStream is) {
		mIs = is;
	}

	public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = mIs.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public String nextLine() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isEndOfLine(c));
		return res.toString();
	}

	public String nextString() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	public long nextLong() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public int nextInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public boolean isSpaceChar(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	public boolean isEndOfLine(int c) {
		return c == '\n' || c == '\r' || c == -1;
	}

}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;

public class Main {

	public static void main(String[] args) {
		TaskA mSol = new TaskA();
		mSol.solve();
		mSol.flush();
		mSol.close();
	}

}

class TaskA {

	public FasterScanner mFScanner;
	public PrintWriter mOut;

	public TaskA() {
		mFScanner = new FasterScanner();
		mOut = new PrintWriter(System.out);
	}

	public void solve() {
		int n, numDollars;
		int[] dollars;
		int[] cents;
		int max = -1;

		n = mFScanner.nextInt();
		numDollars = mFScanner.nextInt();

		dollars = new int[n];
		cents = new int[n];
		numDollars *= 100;

		for (int i = 0; i < n; i++) {
			dollars[i] = mFScanner.nextInt();
			cents[i] = mFScanner.nextInt();
			dollars[i] = dollars[i] * 100 + cents[i];

			if (numDollars >= dollars[i]) {
				if (cents[i] == 0)
					max = Math.max(max, 0);
				else
					max = Math.max(max, 100 - cents[i]);
			}
		}

		mOut.println(max);

	}

	public void flush() {
		mOut.flush();
	}

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

class FasterScanner {
	private InputStream mIs;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;

	public FasterScanner() {
		this(System.in);
	}

	public FasterScanner(InputStream is) {
		mIs = is;
	}

	public int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = mIs.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public String nextLine() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isEndOfLine(c));
		return res.toString();
	}

	public String nextString() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	public long nextLong() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public int nextInt() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public boolean isSpaceChar(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	public boolean isEndOfLine(int c) {
		return c == '\n' || c == '\r' || c == -1;
	}

}


import java.util.Scanner;

public class Av3
{

	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int cash = sc.nextInt() * 100;

		int max = -1;
		for (int i = 0; i < n; i++)
		{

			int price = sc.nextInt() * 100 + sc.nextInt();

			int maxSugar = cash / price;

			if (maxSugar >= 1)
			{
				int change = cash - price * 1;

				int candy = change % 100;

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

			}
		}

		sc.close();
		System.out.println(max);
	}

}


import java.util.Scanner;

public class A
{

	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int s = sc.nextInt() * 100;

		int max = -1;
//		System.out.println(13%(5.50));

		for (int i = 0; i < n; i++)
		{
			int price = sc.nextInt() * 100 + sc.nextInt();

			int remainder = s % price;

			if (s / price >= 1)
			{
				/* do stuff*/
				String str = Integer.toString(remainder);
//				System.out.println(remainder);

				if (str.length() >= 2)
				{
					int candy = Integer.parseInt(str.substring(str.length()-2, str.length()));
//					System.out.println(candy);

					if (candy > max)
						max = candy;
				}
				else
				{
					if (remainder > max)
						max = remainder;
				}

			}
		}

		System.out.println(max);
		sc.close();
	}

}


import java.util.Scanner;

public class A
{

	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int s = sc.nextInt() * 100;

		int max = -1;
//		System.out.println(13%(5.50));

		for (int i = 0; i < n; i++)
		{
			int price = sc.nextInt() * 100 + sc.nextInt();

			int remainder = s % price;

			if (s / price >= 1)
			{
				/* do stuff*/
				String str = Integer.toString(remainder);
//				System.out.println(remainder);

				if (str.length() >= 2)
				{
					int candy = Integer.parseInt(str.substring(str.length()-2, str.length()));
//					System.out.println(candy);

					if (candy > max)
						max = candy;
				}
				else
				{
					if (remainder > max)
						remainder = max;
				}

			}
		}

		System.out.println(max);
		sc.close();
	}

}


import java.util.Scanner;

public class Av2
{

	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);

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

		int max = -1;

		for (int i = 0; i < n; i++)
		{
			double price = sc.nextInt() + sc.nextInt() / 100.0;

			double remainder = (double) s % price;

			if (s / price > 1.0)
			{
				int change = (int) ((remainder - (long) remainder) * 100);

				if (change > max)
					max = change;
			}

		}

		System.out.println(max);
		sc.close();
	}

}


import java.util.Scanner;

public class Av3
{

	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int cash = sc.nextInt() * 100;

		int max = -1;
		for (int i = 0; i < n; i++)
		{
			int price = sc.nextInt() * 100 + sc.nextInt();

			int maxSugar = cash / price;

			if (maxSugar >= 1)
			{
				int change = cash - price * maxSugar;

				int candy = change % 100;

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

		sc.close();
		System.out.println(max);
	}

}


#include <bits/stdc++.h>

using namespace std;

#define PI 3.14159265
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#define f first
#define s second
#define resz resize

#define sz(x) int((x).size())
#define all(x) (x).begin(), (x).end()

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define F0Rd(i, a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto& a : x)

#define sort_by(x, y) sort(all(x), [&](const auto& a, const auto& b) { return y; })

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vd = vector<double>;
using vs = vector<string>;

using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;

using vpii = vector<pii>;
using vpll = vector<pll>;
using vpdd = vector<pdd>;

typedef long long ll;

// point {{{
template<typename T> struct point {
	T x, y;
	point() : x(0), y(0) {}
	point(T _x, T _y) : x(_x), y(_y) {}
	friend istream& operator >> (istream& i, point& p) { return i >> p.x >> p.y; }
	friend ostream& operator << (ostream& o, const point& p) {
		return o << "(" << p.x << ", " << p.y << ")";
	}

	T norm() const { return x * x + y * y; }
	double len() const { return sqrt(norm()); }
	double ang() const { return atan2(y, x); }
	point<T> conj() const { return { x, -y }; }

	point& operator += (const point& o) { x += o.x; y += o.y; return *this; }
	point& operator -= (const point& o) { x -= o.x; y -= o.y; return *this; }
	point& operator *= (const T& c) { x *= c; y *= c; return *this; }
	point& operator /= (const T& c) { x /= c; y /= c; return *this; }
	friend point operator + (const point& a, const point& b) { return point(a) += b; }
	friend point operator - (const point& a, const point& b) { return point(a) -= b; }
	friend point operator * (const point& a, const T& c) { return point(a) *= c; }
	friend point operator * (const T& c, const point& a) { return point(a) *= c; }
	friend point operator / (const point& a, const T& c) { return point(a) /= c; }

	bool operator == (const point& o) const { return x == o.x && y == o.y; }
	bool operator != (const point& o) const { return x != o.x || y != o.y; }
	bool operator < (const point& o) const { return (x != o.x) ? x < o.x : y < o.y; }
	bool operator > (const point& o) const { return (x != o.x) ? x > o.x : y > o.y; }
	bool operator <= (const point& o) const { return !(*this > o); }

	friend T dot(const point& a, const point& b) { return a.x * b.x + a.y * b.y; }
	friend T cross(const point& a, const point& b) { return a.x * b.y - a.y * b.x; }
	friend T cross(const point& p, const point& a, const point& b) { return cross(a - p, b - p); }

	friend point<T> operator * (const point& a, const point& b) {
		return { a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x };
	}
	friend point<T> operator / (const point& a, const point& b) {
		return a * b.conj() / b.norm();
	}

	point dir() const { return point(*this) / len(); }
	point rotate(const double& ang) const { return *this * point(cos(ang), sin(ang)); }

	T dist(const point& a) const { return (a - *this).len(); }
	T dist(const point& a, const point& b) {
		return abs(cross(*this, a, b)) / a.dist(b);
	}
	point reflect(const point& a, const point& b) const {
		return a + ((*this - a) / (b - a)).conj() * (b - a);
	}
	point foot(const point& a, const point& b) const {
		return (*this + this->reflect(a, b)) / 2;
	}
	friend point extension(const point& a, const point& b, const point& c, const point& d) {
		T x = cross(a, b, c), y = cross(a, b, d);
		return (d * x - c * y) / (x - y);
	}

	friend vector<point> seg_intersect(point a, point b, point c, point d) {
		if (a > b) swap(a, b);
		if (c > d) swap(c, d);

		T a1 = cross(a, b, c), a2 = cross(a, b, d);
		if (a1 > a2) swap(a1, a2);
		if (!(a1 <= 0 && a2 >= 0)) return {};

		if (a1 == 0 && a2 == 0) {
			if (cross(a, c, d) != 0) return {};
			point<T> x1 = max(a, c), x2 = min(b, d);
			if (x1 > x2) return {};
			if (x1 == x2) return { x1 };
			return { x1, x2 };
		}

		point<T> z = extension(a, b, c, d);
		if (a <= z && z <= b) return { z };
		return {};
	}

	using polygon = vector<point<T>>;
	friend ostream& operator << (ostream& o, const polygon& poly) {
		o << "{";
		for (auto pt : poly) o << " " << pt;
		return o << " }";
	}

	string classify(const polygon& p) const {
		bool ans = 0;
		for (int i = 0; i < p.size(); i++) {
			point<T> a = p[i], b = p[(i + 1) % p.size()];
			if (cross(a, b, *this) == 0 && min(a, b) <= *this && *this <= max(a, b))
				return "on";
			if (a.y > b.y) swap(a, b);
			if (a.y <= y && y < b.y && cross(*this, a, b) > 0) ans ^= 1;
		}
		return ans ? "in" : "out";
	}

	friend polygon convex_hull(const vector<point>& pts) {
		point pivot = *min_element(all(pts));
		auto sorted = pts;
		sort(all(sorted), [&pivot](const point& p, const point& q) {
			T cp = cross(pivot, p, q);
			if (cp != 0) return cp > 0;
			return pivot.dist(p) < pivot.dist(q);
			});

		int j = 0;
		polygon res(pts.size());
		for (const point& p : sorted) {
			while (j > 1 && cross(res[j - 2], res[j - 1], p) <= 0)
				j--;
			res[j++] = p;
		}
		res.erase(res.begin() + j, res.end());
		return res;
	}

	// twice the signed area
	friend T area(const polygon& p) {
		T a = 0;
		for (int i = 0; i < sz(p); i++)
			a += cross(p[i], p[i + 1 < sz(p) ? i + 1 : 0]);
		return a;
	}
};

vi max_subarray(const vi& a, int l, int r) {
	int n = r - l;
	int best = a[l]; int sum = a[l];
	r = l;
	for (int i = 1; i < n; ++i) {
		if (a[i] > sum + a[i]) {
			l = r = i;
		}
		sum = max(a[i], sum + a[i]);
		if (sum > best) {
			r = i;
			best = sum;
		}
	}

	return { l, r, best };
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  /////////////////////////////////
//   ifstream in("../input.txt");
//   streambuf *cinbuf = cin.rdbuf();
//   cin.rdbuf(in.rdbuf());
  ////////////////////////////////

  int test;
  cin >> test;
  while (test--) {
    int n; cin >> n;
    if(n % 2 == 0) cout << n / 2 << endl;
    else cout << (n - 1) / 2 << endl;
  }

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define PI 3.14159265
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#define f first
#define s second
#define resz resize

#define sz(x) int((x).size())
#define all(x) (x).begin(), (x).end()

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define F0Rd(i, a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto& a : x)

#define sort_by(x, y) sort(all(x), [&](const auto& a, const auto& b) { return y; })

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vd = vector<double>;
using vs = vector<string>;

using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;

using vpii = vector<pii>;
using vpll = vector<pll>;
using vpdd = vector<pdd>;

typedef long long ll;

int gcd(int a, int b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}

int solve(ll n) {
	int res = 0;

	int a = n;
	while (res < 2) {
		for (int i = a - 1; i > 1; --i) {
			res = max(gcd(a, i), res);
		}
		--a;
		if (a == 1) return 1;
	}

	return res;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  /////////////////////////////////
//   ifstream in("../input.txt");
//   streambuf *cinbuf = cin.rdbuf();
//   cin.rdbuf(in.rdbuf());
  ////////////////////////////////

	int test; cin >> test;
	while (test--) {

		ll n; cin >> n;
		cout << solve(n) << endl;
	}

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define PI 3.14159265
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#define f first
#define s second
#define resz resize

#define sz(x) int((x).size())
#define all(x) (x).begin(), (x).end()

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define F0Rd(i, a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto& a : x)

#define sort_by(x, y) sort(all(x), [&](const auto& a, const auto& b) { return y; })

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vd = vector<double>;
using vs = vector<string>;

using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;

using vpii = vector<pii>;
using vpll = vector<pll>;
using vpdd = vector<pdd>;

typedef long long ll;

string solve(int n) {
	if (n < 4) return "NO";
	if (n % 4 == 0) return "YES";
	else return "NO";
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  /////////////////////////////////
//   ifstream in("../input.txt");
//   streambuf *cinbuf = cin.rdbuf();
//   cin.rdbuf(in.rdbuf());
  ////////////////////////////////

	int test; cin >> test;
	while (test--) {

		int n; cin >> n;
		cout << solve(n) << endl;
	}

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define PI 3.14159265
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#define f first
#define s second
#define resz resize

#define sz(x) int((x).size())
#define all(x) (x).begin(), (x).end()

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define F0Rd(i, a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto& a : x)

#define sort_by(x, y) sort(all(x), [&](const auto& a, const auto& b) { return y; })

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vd = vector<double>;
using vs = vector<string>;

using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;

using vpii = vector<pii>;
using vpll = vector<pll>;
using vpdd = vector<pdd>;

typedef long long ll;

int gcd(int a, int b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}

int solve(ll n) {
	return n / 2;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  /////////////////////////////////
//   ifstream in("../input.txt");
//   streambuf *cinbuf = cin.rdbuf();
//   cin.rdbuf(in.rdbuf());
  ////////////////////////////////

	int test; cin >> test;
	while (test--) {

		ll n; cin >> n;
		cout << solve(n) << endl;
	}

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define PI 3.14159265
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#define f first
#define s second
#define resz resize

#define sz(x) int((x).size())
#define all(x) (x).begin(), (x).end()

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define F0Rd(i, a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto& a : x)

#define sort_by(x, y) sort(all(x), [&](const auto& a, const auto& b) { return y; })

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vd = vector<double>;
using vs = vector<string>;

using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;

using vpii = vector<pii>;
using vpll = vector<pll>;
using vpdd = vector<pdd>;

typedef long long ll;

ll solve(ll n) {

	vector<int> divisors(n + 1, 0);

	for (int i = n; i > 0; --i)
	{
		for (int j = 2; j <= sqrt(i); j++)
		{
			if (i % j == 0)
			{
				divisors[j]++;

				if (j != i / j)
					divisors[i / j]++;
			}
		}
	}
	for (int i = n; i > 0; i--) {
		if (divisors[i] > 0)
		{
			return i;
		}

	}

	return 1;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  /////////////////////////////////
//   ifstream in("../input.txt");
//   streambuf *cinbuf = cin.rdbuf();
//   cin.rdbuf(in.rdbuf());
  ////////////////////////////////

	int test; cin >> test;
	while (test--) {

		ll n; cin >> n;
		cout << solve(n) << endl;
	}

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define PI 3.14159265
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define lb lower_bound
#define ub upper_bound
#define f first
#define s second
#define resz resize

#define sz(x) int((x).size())
#define all(x) (x).begin(), (x).end()

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define F0Rd(i, a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto& a : x)

#define sort_by(x, y) sort(all(x), [&](const auto& a, const auto& b) { return y; })

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vd = vector<double>;
using vs = vector<string>;

using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;

using vpii = vector<pii>;
using vpll = vector<pll>;
using vpdd = vector<pdd>;

typedef long long ll;

int gcd(int a, int b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}

int solve(ll n) {
	vi cnt(n + 1, 0);
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= sqrt(i); ++j) {
			if (i % j == 0) cnt[j]++;
			if (j != i / j)
				cnt[i / j]++;
		}
	}

	for (int i = n; i >= 1; --i)
		if (cnt[i] > 1) return i;
	return 1;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  /////////////////////////////////
//   ifstream in("../input.txt");
//   streambuf *cinbuf = cin.rdbuf();
//   cin.rdbuf(in.rdbuf());
  ////////////////////////////////

	int test; cin >> test;
	while (test--) {

		ll n; cin >> n;
		cout << solve(n) << endl;
	}

    return 0;
}


#include<bits/stdc++.h>
#define ll long long int;
using namespace std;
ll gcd(ll a,ll b){
    if(b == 0){
        return a;
    }
    if(a>b){
        return gcd(a%b,b);
    }
    else{
        return gcd(a,b%a);
    }
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t;
    cin>>t;
    while(t--){
        ll n;
        cin>>n;
        ll
        ll great = 0;
        for(ll i=1;i<n;i++){
            ll hcf = gcd(i,i+1);
            if(great < hcf){
                great = hcf;
            }
        }
        cout<<great<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
using namespace std;
ll gcd(ll a,ll b){
    if(b == 0){
        return a;
    }
    if(a>b){
        return gcd(a%b,b);
    }
    else{
        return gcd(a,b%a);
    }
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t;
    cin>>t;
    while(t--){
        ll n;
        cin>>n;
        ll
        ll great = 0;
        for(ll i=1;i<n;i++){
            ll hcf = gcd(i,i+1);
            if(great < hcf){
                great = hcf;
            }
        }
        cout<<great<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int gcd(long long int a,long long int b){
    if(b == 0){
        return a;
    }
    if(a == 0){
        return b;
    }
    if(a>b){
        return gcd(a%b,b);
    }
    else{
        return gcd(a,b%a);
    }
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin>>t;
    while(t--){
        long long int n;
        cin>>n;

        int great = 0;
        for(long long int i=1;i<n;i++){
            int hcf = gcd(i,i+1);
            if(great < hcf){
                great = hcf;
            }
        }
        cout<<great<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long int;
using namespace std;
int gcd(ll a,ll b){
    if(b == 0){
        return a;
    }
    if(a>b){
        return gcd(a%b,b);
    }
    else{
        return gcd(a,b%a);
    }
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t;
    cin>>t;
    while(t--){
        ll n;
        cin>>n;
        ll great = 0;
        for(ll i=1;i<n;i++){
            ll hcf = gcd(i,i+1);
            if(great < hcf){
                great = hcf;
            }
        }
        cout<<great<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
using namespace std;
int main(){
    fastio;
    ll t;
    cin>>t;
    while(t--){
        ll n;
        cin>>n;
        cout<<n/2<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int gcd(long long int a,long long int b){
    if(b == 0){
        return a;
    }
    if(a>b){
        return gcd(a%b,b);
    }
    else{
        return gcd(a,b%a);
    }
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin>>t;
    while(t--){
        long long int n;
        cin>>n;

        int great = 0;
        for(long long int i=1;i<n;i++){
            int hcf = gcd(i,i+1);
            if(great < hcf){
                great = hcf;
            }
        }
        cout<<great<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int gcd(long long int a,long long int b){
    if(b == 0){
        return a;
    }
    if(a == 0){
        return b;
    }
    if(a>b){
        return gcd(a%b,b);
    }
    else{
        return gcd(a,b%a);
    }
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin>>t;
    while(t--){
        long long int n;
        cin>>n;

        int great = 0;
        for(long long int i=1;i<n;i++){
            for(long long int j=i;j<=n;j++){
                int hcf = gcd(i,j);
                if(great < hcf){
                    great = hcf;
                }
            }
        }
        cout<<great<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ll long long
#define ld long double
ll const N=1e6+5;
ll const INF=8223372036854775807;

#define pb push_back
#define popb pop_back()
#define pf push_front
#define popf pop_front()
#define si size()
#define be begin()
#define en end()
#define all(v) v.be, v.en
#define len length()
#define mp make_pair
#define mt make_tuple
#define umap unordered_map
#define uset unordered_set
#define acc(v) accumulate(all(v), 0)
#define F first
#define S second

#define forz(i, n) for (ll i = 0; i < n; i++)
#define fore(i, m, n) for (ll i = m; i <= n; i++)
#define rforz(i, n) for (ll i = n - 1; i >= 0; i--)
#define rfore(i, m, n) for (ll i = n; i >= m; i--)
#define deci(n) fixed << setprecision(n)
#define high(n) __builtin_popcount(n)
#define highll(n) __builtin_popcountll(n)
#define parity(n) __builtin_parity(n)
#define ctz(n) __builtin_ctz(n)
#define lb lower_bound
#define ub upper_bound
#define er equal_range
#define maxe *max_element
#define mine *min_element
#define mod 1000000007
#define mod2 998244353
#define PI 3.1415926535
#define gcd __gcd
#define prag ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)

#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl

typedef pair<ll,ll> pll;
typedef pair<pll,ll> plll;

/*
// GRAPHS
vector<ll> adj[N];

ll depth[N],sizz[N];
bool visited[N];
// ll clr[N];

void bfs(ll s,ll p){
    sizz[s]=1;
    visited[s]=true;

    for(auto x:adj[s]){
        if(x==p){
            continue;
        }

            if(visited[x]==false)
            {

            depth[x]=depth[s]+1;
            bfs(x,s);
            sizz[s]=sizz[s]+sizz[x];

            }

    }
}

*/

bool checkPrime(ll x)
{
    if (x == 1)
    {
        return false;
    }
    if (x <= 3)
    {
        return true;
    }
    ll t = 2;
    if (x % 2 == 0)
    {
        return false;
    }
    t = 3;
    for (t; t <= sqrt(x); t += 2)
    {
        if (x % t == 0)
        {
            return false;
        }
    }
    return true;
}

/// used for internal sorting in minpriority queue
template <class pll> struct greatter : binary_function <pll,pll,bool> {
  bool operator() (const pll& p1, const pll& p2) const
  {
    if(p2.S-p2.F>p1.S-p1.F) return true;
    else if(p2.S-p2.F==p1.S-p1.F)
    {
        if(p1.F>p2.F)  return true;
        else return false;
    }
    else return false;
  }
};

ll power(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;

    while (y > 0)
    {

        if (y & 1)
            res = (res*x) % p;

        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

ll modInverse(ll n, ll p)
{
    return power(n, p-2, p);
}

ll nCrModPFermat(ll n, ll r, ll p)
{

   if (r==0)
      return 1;

    ll fac[n+1];
    fac[0] = 1;
    for (ll i=1 ; i<=n; i++)
        fac[i] = fac[i-1]*i%p;

    return (fac[n] % p * modInverse(fac[r], p) % p* modInverse(fac[n-r], p) % p) % p;
}

// ll dp[3605][8005];
// ll countsubsets(vector<ll> arr,ll ss, ll i,ll remsum)
// {
//    if(i==ss)
//    {
//        if(remsum==0) return 1;
//        else return 0;
//    }

//    if(dp[i][remsum]!=-1) return dp[i][remsum];
//    else
//    {
//        dp[i][remsum]=countsubsets(arr,ss,i+1,remsum)+countsubsets(arr,ss,i+1,remsum-arr[i]);
//        return  dp[i][remsum];
//    }

// }

bool comp(char c1,char c2)
{
    if(c1>c2) return true;
    else return false;
}

// ll count(ll a, ll b, ll limit)
// {
// ll initialcount=limit/(a+b);
// ll ans=2*initialcount;
// if(limit%(a+b)>= a)
// ans++;
// return ans;
// }

int main()
{
        prag;
        ll T=1;
        cin>>T;
        while(T--)
        {

	      ll n,i,k=INT_MIN;
          cin>>n;
          for(i=n;i>=1;i--)
          {
              if(!checkPrime(i))
              {
              for(ll j=2;j<=sqrt(i);j++)
                {  if(i%j==0)
                   {
                      ll p=max(j,i/j);
                      k=max(k,p);
                      break;

                   }
                }

              }

          }

          if(k==INT_MIN) p1(1);
          else p1(k);

        }

        return 0;

}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ll long long
#define ld long double
ll const N=1e6+5;
ll const INF=8223372036854775807;

#define pb push_back
#define popb pop_back()
#define pf push_front
#define popf pop_front()
#define si size()
#define be begin()
#define en end()
#define all(v) v.be, v.en
#define len length()
#define mp make_pair
#define mt make_tuple
#define umap unordered_map
#define uset unordered_set
#define acc(v) accumulate(all(v), 0)
#define F first
#define S second

#define forz(i, n) for (ll i = 0; i < n; i++)
#define fore(i, m, n) for (ll i = m; i <= n; i++)
#define rforz(i, n) for (ll i = n - 1; i >= 0; i--)
#define rfore(i, m, n) for (ll i = n; i >= m; i--)
#define deci(n) fixed << setprecision(n)
#define high(n) __builtin_popcount(n)
#define highll(n) __builtin_popcountll(n)
#define parity(n) __builtin_parity(n)
#define ctz(n) __builtin_ctz(n)
#define lb lower_bound
#define ub upper_bound
#define er equal_range
#define maxe *max_element
#define mine *min_element
#define mod 1000000007
#define mod2 998244353
#define PI 3.1415926535
#define gcd __gcd
#define prag ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)

#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl

typedef pair<ll,ll> pll;
typedef pair<pll,ll> plll;

/*
// GRAPHS
vector<ll> adj[N];

ll depth[N],sizz[N];
bool visited[N];
// ll clr[N];

void bfs(ll s,ll p){
    sizz[s]=1;
    visited[s]=true;

    for(auto x:adj[s]){
        if(x==p){
            continue;
        }

            if(visited[x]==false)
            {

            depth[x]=depth[s]+1;
            bfs(x,s);
            sizz[s]=sizz[s]+sizz[x];

            }

    }
}

*/

bool checkPrime(ll x)
{
    if (x == 1)
    {
        return false;
    }
    if (x <= 3)
    {
        return true;
    }
    ll t = 2;
    if (x % 2 == 0)
    {
        return false;
    }
    t = 3;
    for (t; t <= sqrt(x); t += 2)
    {
        if (x % t == 0)
        {
            return false;
        }
    }
    return true;
}

/// used for internal sorting in minpriority queue
template <class pll> struct greatter : binary_function <pll,pll,bool> {
  bool operator() (const pll& p1, const pll& p2) const
  {
    if(p2.S-p2.F>p1.S-p1.F) return true;
    else if(p2.S-p2.F==p1.S-p1.F)
    {
        if(p1.F>p2.F)  return true;
        else return false;
    }
    else return false;
  }
};

ll power(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;

    while (y > 0)
    {

        if (y & 1)
            res = (res*x) % p;

        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

ll modInverse(ll n, ll p)
{
    return power(n, p-2, p);
}

ll nCrModPFermat(ll n, ll r, ll p)
{

   if (r==0)
      return 1;

    ll fac[n+1];
    fac[0] = 1;
    for (ll i=1 ; i<=n; i++)
        fac[i] = fac[i-1]*i%p;

    return (fac[n] % p * modInverse(fac[r], p) % p* modInverse(fac[n-r], p) % p) % p;
}

// ll dp[3605][8005];
// ll countsubsets(vector<ll> arr,ll ss, ll i,ll remsum)
// {
//    if(i==ss)
//    {
//        if(remsum==0) return 1;
//        else return 0;
//    }

//    if(dp[i][remsum]!=-1) return dp[i][remsum];
//    else
//    {
//        dp[i][remsum]=countsubsets(arr,ss,i+1,remsum)+countsubsets(arr,ss,i+1,remsum-arr[i]);
//        return  dp[i][remsum];
//    }

// }

bool comp(char c1,char c2)
{
    if(c1>c2) return true;
    else return false;
}

// ll count(ll a, ll b, ll limit)
// {
// ll initialcount=limit/(a+b);
// ll ans=2*initialcount;
// if(limit%(a+b)>= a)
// ans++;
// return ans;
// }

int main()
{
        prag;
        ll T=1;
        cin>>T;
        while(T--)
        {

	      ll n,i,k=INT_MIN;
          cin>>n;
          for(i=n;i>=1;i--)
          {
              if(!checkPrime(i))
              {
              for(ll j=2;j<=sqrt(i);j++)
                {  if(i%j==0)
                   {
                      k=max(j,i/j);

                      break;

                   }
                }

                break;

              }

          }

          if(k==INT_MIN) p1(1);
          else p1(k);

        }

        return 0;

}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ll long long
#define ld long double
ll const N=1e6+5;
ll const INF=8223372036854775807;

#define pb push_back
#define popb pop_back()
#define pf push_front
#define popf pop_front()
#define si size()
#define be begin()
#define en end()
#define all(v) v.be, v.en
#define len length()
#define mp make_pair
#define mt make_tuple
#define umap unordered_map
#define uset unordered_set
#define acc(v) accumulate(all(v), 0)
#define F first
#define S second

#define forz(i, n) for (ll i = 0; i < n; i++)
#define fore(i, m, n) for (ll i = m; i <= n; i++)
#define rforz(i, n) for (ll i = n - 1; i >= 0; i--)
#define rfore(i, m, n) for (ll i = n; i >= m; i--)
#define deci(n) fixed << setprecision(n)
#define high(n) __builtin_popcount(n)
#define highll(n) __builtin_popcountll(n)
#define parity(n) __builtin_parity(n)
#define ctz(n) __builtin_ctz(n)
#define lb lower_bound
#define ub upper_bound
#define er equal_range
#define maxe *max_element
#define mine *min_element
#define mod 1000000007
#define mod2 998244353
#define PI 3.1415926535
#define gcd __gcd
#define prag ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)

#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl

typedef pair<ll,ll> pll;
typedef pair<pll,ll> plll;

/*
// GRAPHS
vector<ll> adj[N];

ll depth[N],sizz[N];
bool visited[N];
// ll clr[N];

void bfs(ll s,ll p){
    sizz[s]=1;
    visited[s]=true;

    for(auto x:adj[s]){
        if(x==p){
            continue;
        }

            if(visited[x]==false)
            {

            depth[x]=depth[s]+1;
            bfs(x,s);
            sizz[s]=sizz[s]+sizz[x];

            }

    }
}

*/

bool checkPrime(ll x)
{
    if (x == 1)
    {
        return false;
    }
    if (x <= 3)
    {
        return true;
    }
    ll t = 2;
    if (x % 2 == 0)
    {
        return false;
    }
    t = 3;
    for (t; t <= sqrt(x); t += 2)
    {
        if (x % t == 0)
        {
            return false;
        }
    }
    return true;
}

/// used for internal sorting in minpriority queue
template <class pll> struct greatter : binary_function <pll,pll,bool> {
  bool operator() (const pll& p1, const pll& p2) const
  {
    if(p2.S-p2.F>p1.S-p1.F) return true;
    else if(p2.S-p2.F==p1.S-p1.F)
    {
        if(p1.F>p2.F)  return true;
        else return false;
    }
    else return false;
  }
};

ll power(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;

    while (y > 0)
    {

        if (y & 1)
            res = (res*x) % p;

        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

ll modInverse(ll n, ll p)
{
    return power(n, p-2, p);
}

ll nCrModPFermat(ll n, ll r, ll p)
{

   if (r==0)
      return 1;

    ll fac[n+1];
    fac[0] = 1;
    for (ll i=1 ; i<=n; i++)
        fac[i] = fac[i-1]*i%p;

    return (fac[n] % p * modInverse(fac[r], p) % p* modInverse(fac[n-r], p) % p) % p;
}

// ll dp[3605][8005];
// ll countsubsets(vector<ll> arr,ll ss, ll i,ll remsum)
// {
//    if(i==ss)
//    {
//        if(remsum==0) return 1;
//        else return 0;
//    }

//    if(dp[i][remsum]!=-1) return dp[i][remsum];
//    else
//    {
//        dp[i][remsum]=countsubsets(arr,ss,i+1,remsum)+countsubsets(arr,ss,i+1,remsum-arr[i]);
//        return  dp[i][remsum];
//    }

// }

bool comp(char c1,char c2)
{
    if(c1>c2) return true;
    else return false;
}

// ll count(ll a, ll b, ll limit)
// {
// ll initialcount=limit/(a+b);
// ll ans=2*initialcount;
// if(limit%(a+b)>= a)
// ans++;
// return ans;
// }

int main()
{
        prag;
        ll T=1;
        cin>>T;
        while(T--)
        {

	      ll n,i;
          cin>>n;
          for(i=n;i>=1;i--)
          {
              if(!checkPrime(i))
              {
              for(ll j=2;j<=sqrt(n);j++)
                {  if(i%j==0)
                   {
                       ll k=max(j,i/j);
                       p1(k);

                   break;
                   }
                }
              break;
              }

          }

          if(i==1) p1(1);

        }

        return 0;

}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ll long long
#define ld long double
ll const N=1e6+5;
ll const INF=8223372036854775807;

#define pb push_back
#define popb pop_back()
#define pf push_front
#define popf pop_front()
#define si size()
#define be begin()
#define en end()
#define all(v) v.be, v.en
#define len length()
#define mp make_pair
#define mt make_tuple
#define umap unordered_map
#define uset unordered_set
#define acc(v) accumulate(all(v), 0)
#define F first
#define S second

#define forz(i, n) for (ll i = 0; i < n; i++)
#define fore(i, m, n) for (ll i = m; i <= n; i++)
#define rforz(i, n) for (ll i = n - 1; i >= 0; i--)
#define rfore(i, m, n) for (ll i = n; i >= m; i--)
#define deci(n) fixed << setprecision(n)
#define high(n) __builtin_popcount(n)
#define highll(n) __builtin_popcountll(n)
#define parity(n) __builtin_parity(n)
#define ctz(n) __builtin_ctz(n)
#define lb lower_bound
#define ub upper_bound
#define er equal_range
#define maxe *max_element
#define mine *min_element
#define mod 1000000007
#define mod2 998244353
#define PI 3.1415926535
#define gcd __gcd
#define prag ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)

#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl

typedef pair<ll,ll> pll;
typedef pair<pll,ll> plll;

/*
// GRAPHS
vector<ll> adj[N];

ll depth[N],sizz[N];
bool visited[N];
// ll clr[N];

void bfs(ll s,ll p){
    sizz[s]=1;
    visited[s]=true;

    for(auto x:adj[s]){
        if(x==p){
            continue;
        }

            if(visited[x]==false)
            {

            depth[x]=depth[s]+1;
            bfs(x,s);
            sizz[s]=sizz[s]+sizz[x];

            }

    }
}

*/

bool checkPrime(ll x)
{
    if (x == 1)
    {
        return false;
    }
    if (x <= 3)
    {
        return true;
    }
    ll t = 2;
    if (x % 2 == 0)
    {
        return false;
    }
    t = 3;
    for (t; t <= sqrt(x); t += 2)
    {
        if (x % t == 0)
        {
            return false;
        }
    }
    return true;
}

/// used for internal sorting in minpriority queue
template <class pll> struct greatter : binary_function <pll,pll,bool> {
  bool operator() (const pll& p1, const pll& p2) const
  {
    if(p2.S-p2.F>p1.S-p1.F) return true;
    else if(p2.S-p2.F==p1.S-p1.F)
    {
        if(p1.F>p2.F)  return true;
        else return false;
    }
    else return false;
  }
};

ll power(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;

    while (y > 0)
    {

        if (y & 1)
            res = (res*x) % p;

        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

ll modInverse(ll n, ll p)
{
    return power(n, p-2, p);
}

ll nCrModPFermat(ll n, ll r, ll p)
{

   if (r==0)
      return 1;

    ll fac[n+1];
    fac[0] = 1;
    for (ll i=1 ; i<=n; i++)
        fac[i] = fac[i-1]*i%p;

    return (fac[n] % p * modInverse(fac[r], p) % p* modInverse(fac[n-r], p) % p) % p;
}

// ll dp[3605][8005];
// ll countsubsets(vector<ll> arr,ll ss, ll i,ll remsum)
// {
//    if(i==ss)
//    {
//        if(remsum==0) return 1;
//        else return 0;
//    }

//    if(dp[i][remsum]!=-1) return dp[i][remsum];
//    else
//    {
//        dp[i][remsum]=countsubsets(arr,ss,i+1,remsum)+countsubsets(arr,ss,i+1,remsum-arr[i]);
//        return  dp[i][remsum];
//    }

// }

bool comp(char c1,char c2)
{
    if(c1>c2) return true;
    else return false;
}

// ll count(ll a, ll b, ll limit)
// {
// ll initialcount=limit/(a+b);
// ll ans=2*initialcount;
// if(limit%(a+b)>= a)
// ans++;
// return ans;
// }

int main()
{
        prag;
        ll T=1;
        cin>>T;
        while(T--)
        {

	      ll n,i,k=INT_MIN;
          cin>>n;
          for(i=n;i>=1;i--)
          {
              if(!checkPrime(i))
              {
              for(ll j=2;j<=sqrt(i);j++)
                {  if(i%j==0)
                   {
                      ll p=max(j,i/j);
                      k=max(k,p);

                   }
                }

              }

          }

          if(k==INT_MIN) p1(1);
          else p1(k);

        }

        return 0;

}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;

#define ll long long
#define ld long double
ll const N=1e6+5;
ll const INF=8223372036854775807;

#define pb push_back
#define popb pop_back()
#define pf push_front
#define popf pop_front()
#define si size()
#define be begin()
#define en end()
#define all(v) v.be, v.en
#define len length()
#define mp make_pair
#define mt make_tuple
#define umap unordered_map
#define uset unordered_set
#define acc(v) accumulate(all(v), 0)
#define F first
#define S second

#define forz(i, n) for (ll i = 0; i < n; i++)
#define fore(i, m, n) for (ll i = m; i <= n; i++)
#define rforz(i, n) for (ll i = n - 1; i >= 0; i--)
#define rfore(i, m, n) for (ll i = n; i >= m; i--)
#define deci(n) fixed << setprecision(n)
#define high(n) __builtin_popcount(n)
#define highll(n) __builtin_popcountll(n)
#define parity(n) __builtin_parity(n)
#define ctz(n) __builtin_ctz(n)
#define lb lower_bound
#define ub upper_bound
#define er equal_range
#define maxe *max_element
#define mine *min_element
#define mod 1000000007
#define mod2 998244353
#define PI 3.1415926535
#define gcd __gcd
#define prag ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)

#define endl "\n"
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl

typedef pair<ll,ll> pll;
typedef pair<pll,ll> plll;

/*
// GRAPHS
vector<ll> adj[N];

ll depth[N],sizz[N];
bool visited[N];
// ll clr[N];

void bfs(ll s,ll p){
    sizz[s]=1;
    visited[s]=true;

    for(auto x:adj[s]){
        if(x==p){
            continue;
        }

            if(visited[x]==false)
            {

            depth[x]=depth[s]+1;
            bfs(x,s);
            sizz[s]=sizz[s]+sizz[x];

            }

    }
}

*/

bool checkPrime(ll x)
{
    if (x == 1)
    {
        return false;
    }
    if (x <= 3)
    {
        return true;
    }
    ll t = 2;
    if (x % 2 == 0)
    {
        return false;
    }
    t = 3;
    for (t; t <= sqrt(x); t += 2)
    {
        if (x % t == 0)
        {
            return false;
        }
    }
    return true;
}

/// used for internal sorting in minpriority queue
template <class pll> struct greatter : binary_function <pll,pll,bool> {
  bool operator() (const pll& p1, const pll& p2) const
  {
    if(p2.S-p2.F>p1.S-p1.F) return true;
    else if(p2.S-p2.F==p1.S-p1.F)
    {
        if(p1.F>p2.F)  return true;
        else return false;
    }
    else return false;
  }
};

ll power(ll x, ll y, ll p)
{
    ll res = 1;
    x = x % p;

    while (y > 0)
    {

        if (y & 1)
            res = (res*x) % p;

        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}

ll modInverse(ll n, ll p)
{
    return power(n, p-2, p);
}

ll nCrModPFermat(ll n, ll r, ll p)
{

   if (r==0)
      return 1;

    ll fac[n+1];
    fac[0] = 1;
    for (ll i=1 ; i<=n; i++)
        fac[i] = fac[i-1]*i%p;

    return (fac[n] % p * modInverse(fac[r], p) % p* modInverse(fac[n-r], p) % p) % p;
}

// ll dp[3605][8005];
// ll countsubsets(vector<ll> arr,ll ss, ll i,ll remsum)
// {
//    if(i==ss)
//    {
//        if(remsum==0) return 1;
//        else return 0;
//    }

//    if(dp[i][remsum]!=-1) return dp[i][remsum];
//    else
//    {
//        dp[i][remsum]=countsubsets(arr,ss,i+1,remsum)+countsubsets(arr,ss,i+1,remsum-arr[i]);
//        return  dp[i][remsum];
//    }

// }

bool comp(char c1,char c2)
{
    if(c1>c2) return true;
    else return false;
}

// ll count(ll a, ll b, ll limit)
// {
// ll initialcount=limit/(a+b);
// ll ans=2*initialcount;
// if(limit%(a+b)>= a)
// ans++;
// return ans;
// }

int main()
{
        prag;
        ll T=1;
        cin>>T;
        while(T--)
        {

	      ll n,i,k=INT_MIN;
          cin>>n;
          for(i=n;i>=1;i--)
          {
              if(!checkPrime(i))
              {
              for(ll j=2;j<=sqrt(i);j++)
                {  if(i%j==0)
                   {
                      k=max(k,max(j,i/j));

                   }
                }

              }

          }

          if(i==0 && k==INT_MIN) p1(1);
          else p1(k);

        }

        return 0;

}