import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        for(int i = 0; i < T; ++i){
            int s = sc.nextInt();
            int n = sc.nextInt();
            int d = sc.nextInt();
            int x = sc.nextInt();
            int y = sc.nextInt();
            int t0 = sc.nextInt();
            int t1 = sc.nextInt();
            int t2 = sc.nextInt();
            int j = 0;//用j来计时
            while(true){
                if(j%t0 == 0) s -= n*d;//小兵先打
                if(s <= 0){
                    System.out.println("NO");
                    break;
                }
                if(j%t1 == 0) s -= y;//小明后打
                if(j%t2 == 0) s -= x;
                if(s <= 0){
                    System.out.println("YES");
                    break;
                }
                j++;//时间+1
            }
        }
    }
}