My issue
I DONT KNOW
My code
import java.util.Scanner;
class Codechef {
public static void main(String[] args) {
Scanner read = new Scanner(System.in);
int t = read.nextInt();
for (int i = 0; i < t; i++) {
int x = read.nextInt();
int y = read.nextInt();
int z = read.nextInt();
solve(x, y, z);
}
}
static void solve(int x, int y, int z) {
// Total legs of all birds on the farm
int totalLegs = x * 2 + y * 4;
// Check conditions to determine the type of bird(s)
if (z % 2 == 0 && z >= x * 2 && z <= totalLegs) {
if (z % 4 == 0 || z % 2 == 0) {
System.out.println("CHICKEN");
} else {
System.out.println("ANY");
}
} else {
System.out.println("NONE");
}
}
}
Learning course: Placement preparation using Java
Problem Link: Problem(Farm animals) - Solve the complete problem Practice Problem in Placement preparation using Java - CodeChef