给的例子手动测试过了,但是拷贝上去 报错,不通过
public class 牛牛吃雪糕 {
static String[] res = null;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();// 数据组数
res = new String[N];
int[][] data = new int[N][4];
for (int i = 0; i < N; i++) {
Scanner scc = new Scanner(System.in);
String[] input = scc.nextLine().split(" ");
for (int j = 0; j < input.length; j++) {
data[i][j] = Integer.parseInt(input[j]);
}
}
iceCream(data);
for (int i = 0; i < res.length; i++) {
System.out.println(res[i]);
}
}
public static void iceCream(int[][] data) {
for (int i = 0; i < data.length; i++) {
int n = data[i][0];
int a = data[i][1];
int b = data[i][2];
int c = data[i][3];
process(i, n, a, b, c);
}
}
public static void process(int i, int n, int a, int b, int c) {
int aDay = a / 6;
int bDay = b / 3;
int cDay = c / 2;
int resDay = n - (aDay + bDay + cDay);// 剩余的天数
if (resDay <= 0) {
res[i] = "Yes";
return;
} else {
int resA = a % 6;
int resB = b % 3;
int resC = c % 2;
if ((resC == 1 && resA >= 3) || (resB == 1 && resA >= 4) || (resB == 2 && resA >= 2)
|| (resC == 1 && resB >= 1 && resA >= 1)) {
res[i] = "Yes";
return;
}
}
res[i] = "No";
}
}