My issue
My code
// Update the code below to solve this problem
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();
int numBreaks = X / 3;
// Calculate total time without breaks
int totalTimeWithoutBreaks = X * Y;
// Calculate total break time
int totalBreakTime = numBreaks * Z;
// Calculate total time for completing the game
int totalTime = totalTimeWithoutBreaks + totalBreakTime;
// Output the result
System.out.println(totalTime);
}
}
}
Learning course: Solve Programming problems using Java
Problem Link: CodeChef: Practical coding for everyone