Problem: The great hero guards the country where Homer lives. The hero has attack power A and initial health value B. There are n monsters in front of the hero. The i-th monster has attack power a_i and initial health value b_i. 

The hero or a monster is said to be living, if his or its health value is positive (greater than or equal to 1); and he or it is said to be dead, if his or its health value is non-positive (less than or equal to 0).

In order to protect people in the country, the hero will fight with monsters until either the hero is dead or all the monsters are dead.

  * In each fight, the hero can select an arbitrary living monster and fight with it. Suppose the i-th monster is selected, and the health values of the hero and the i-th monster are x and y before the fight, respectively. After the fight, the health values of the hero and the i-th monster become x-a_i and y-A, respectively. 



Note that the hero can fight the same monster more than once.

For the safety of the people in the country, please tell them whether the great hero can kill all the monsters (even if the great hero himself is dead after killing the last monster).

Input

Each test contains multiple test cases. The first line contains t (1 ≤ t ≤ 10^5) — the number of test cases. Description of the test cases follows.

The first line of each test case contains three integers A (1 ≤ A ≤ 10^6), B (1 ≤ B ≤ 10^6) and n (1 ≤ n ≤ 10^5) — the attack power of the great hero, the initial health value of the great hero, and the number of monsters.

The second line of each test case contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 10^6), where a_i denotes the attack power of the i-th monster.

The third line of each test case contains n integers b_1, b_2, ..., b_n (1 ≤ b_i ≤ 10^6), where b_i denotes the initial health value of the i-th monster.

It is guaranteed that the sum of n over all test cases does not exceed 10^5.

Output

For each test case print the answer: "YES" (without quotes) if the great hero can kill all the monsters. Otherwise, print "NO" (without quotes).

Example

Input


5
3 17 1
2
16
10 999 3
10 20 30
100 50 30
1000 1000 4
200 300 400 500
1000 1000 1000 1000
999 999 1
1000
1000
999 999 1
1000000
999


Output


YES
YES
YES
NO
YES

Note

In the first example: There will be 6 fights between the hero and the only monster. After that, the monster is dead and the health value of the hero becomes 17 - 6 × 2 = 5 > 0. So the answer is "YES", and moreover, the hero is still living.

In the second example: After all monsters are dead, the health value of the hero will become 709, regardless of the order of all fights. So the answer is "YES".

In the third example: A possible order is to fight with the 1-st, 2-nd, 3-rd and 4-th monsters. After all fights, the health value of the hero becomes -400. Unfortunately, the hero is dead, but all monsters are also dead. So the answer is "YES".

In the fourth example: The hero becomes dead but the monster is still living with health value 1000 - 999 = 1. So the answer is "NO".

Solution (in JAVA):

Solution:
import java.io.*;
import java.util.*;

public class Main {
    static Reader br = new Reader();
    static final int mod = 1000000007;
    static final double EPS = 1e-14;

    public static long gcd(long a, long b) {
        while (b > 0) {
            long c = a;
            a = b;
            b = c % b;
        }
        return a;
    }

    public static int ni() throws IOException {
        return br.nextInt();
    }

    public static int max(int a, int b) {
        return Integer.max(a, b);
    }

    public static long max(long a, long b) {
        return Long.max(a, b);
    }

    public static double max(double a, double b) {
        return Double.max(a, b);
    }

    public static int min(int a, int b) {
        return Integer.min(a, b);
    }

    public static long min(long a, long b) {
        return Long.min(a, b);
    }

    public static double min(double a, double b) {
        return Double.min(a, b);
    }


    public static long nl() throws IOException {
        return br.nextLong();
    }

    public static double nd() throws IOException {
        return br.nextDouble();
    }

    public static int[] nia(int n) throws IOException {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = ni();
        }
        return a;
    }

    public static long[] nil(int n) throws IOException {
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = nl();
        }
        return a;
    }

    static boolean isPowerOfTwo(long x) {
      /* First x in the below expression is
        for the case when x is 0 */
        return x != 0 && ((x & (x - 1)) == 0);

    }

    public static void main(String[] args) throws IOException {
        //a();
        b();
        //c();
        //d();
        //e();
    }

    //Problem A
    static void a() throws IOException {

        BufferedReader xxx = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(xxx.readLine());
        ;
        while (t-- > 0) {
            String[] s = xxx.readLine().split("");
            for (int i = 0; i < s.length; i++) {
                if (i % 2 == 0) {
                    if (s[i].equals("a"))
                        s[i] = "b";
                    else
                        s[i] = "a";
                } else {
                    if (s[i].equals("z"))
                        s[i] = "y";
                    else
                        s[i] = "z";
                }
            }
            for (int i = 0; i < s.length; i++) {
                System.out.print(s[i]);
            }
            System.out.println();
        }
    }

    //Problem B
    static void b() throws IOException {
        BufferedReader xxx = new BufferedReader(new InputStreamReader(System.in));
        int t = Integer.parseInt(xxx.readLine());
        while (t-- > 0) {
            String[] inp3 = xxx.readLine().split(" ");
            int a = Integer.parseInt(inp3[0]), b = Integer.parseInt(inp3[1]), n = Integer.parseInt(inp3[2]);

            int[] ar = new int[n]; //monster attack
            int[] br = new int[n]; //monster health

            String[] inp1 = xxx.readLine().split(" ");
            String[] inp2 = xxx.readLine().split(" ");

            for (int i = 0; i < n; i++) {
                ar[i] = Integer.parseInt(inp1[i]);
                br[i] = Integer.parseInt(inp2[i]);
            }
            int[] health_left = new int[n];
            for (int i = 0; i < n; i++) {
                int x = (int) Math.ceil((double) br[i] / (double) a);
                health_left[i] = (b - (x * ar[i]));
            }
            ArrayList<ArrayList<Integer>> list = new ArrayList<>();
            for (int i = 0; i < n; i++) {
                ArrayList<Integer> temp = new ArrayList<>(); //attack monster, health monster, health left
                //sort by attack monster
                //sort by health left
                temp.add(ar[i]);
                temp.add(br[i]);
                temp.add(health_left[i]);
                list.add(temp);
            }

            Collections.sort(list, Comparator.comparing(o -> o.get(0)));
            //Collections.sort(list, (o1, o2) -> o2.get(2).compareTo(o1.get(2)));
            //list.forEach(System.out::println);
            int i = 0;
            int count = 0;
            //System.out.println(b);
            while (b > 0 && i < n) {
                ArrayList<Integer> temp = list.get(i);
                int fight_hero = (int) Math.ceil((double) temp.get(1) / (double) a);
                int fight_monster = (int) Math.ceil((double) b / (double) temp.get(0));
                if(fight_hero <= fight_monster)
                    count++;

                b = b-(fight_hero*temp.get(0));
                //System.out.println(b);
                i++;

            }
            if(count==n)
                System.out.println("YES");
            else
                System.out.println("NO");
        }
    }

    //Problem C
    static void c() throws IOException {
        int t = ni();
        while (t-- > 0) {
            //int n = ni();
        }
    }

    //Problem D
    static void d() throws IOException {
        int t = ni();
        while (t-- > 0) {
            //int n = ni();
        }
    }

    //Problem E
    static void e() throws IOException {
        int t = ni();
        while (t-- > 0) {
            //int n = ni();
        }
    }


    static class Reader {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader() {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1) {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            } while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.') {
                while ((c = read()) >= '0' && c <= '9') {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException {
            if (din == null)
                return;
            din.close();
        }
    }
}