package xyz.liuyingdi.test; import java.util.Scanner; public class Main {          public static void main(String[] args) {                  Scanner sc = new Scanner(System.in);         while (sc.hasNextInt()) {             int testTimes = sc.nextInt();             for(int i = 0; i < testTimes; i++) {                 int n = sc.nextInt();                 int a = sc.nextInt();                 int b = sc.nextInt();                 int c = sc.nextInt();                 System.out.println(solve(n, a, b, c));             }         }     }          public static String solve(int n, int a, int b, int c) {                  boolean flag = true;         for(int i = 0; i < n; i++) {             if(c >= 2) {  // 0 0 2                 c -= 2;             }             else if(c >= 1 && b >= 1 && a >= 1) {  // 1 1 1                 c -= 1;                 b -= 1;                 a -= 1;             }             else if(c >= 1 && a >= 3) {  // 3 0 1                 c -= 1;                 a -= 3;             }             else if(b >= 3) {  // 0 3 0                 b -= 3;             }             else if(b >= 2 && a >= 2) {  // 2 2 0                 b -= 2;                 a -= 2;             }             else if(b >= 1 && a >= 4) {  // 4 1 0                 b -= 1;                 a -= 4;             }             else if(a >= 6) {  // 6 0 0                 a -= 6;             }             else {                 flag = false;                 break;             }         }                  String str = flag ? "Yes" : "No";         return str;     } }
点赞 2

相关推荐

头发暂时没有的KFC总裁:找廉价劳动力罢了
点赞 评论 收藏
分享
沟头学院:无关比赛不要写,这样会显着你主次不分,比赛不要撒谎,有哪些就写那些,创新创业建议删除。技能特长可以适当夸大。
点赞 评论 收藏
分享
牛客网
牛客企业服务