Help me in solving CCHOCOLATES problem

My issue

Runtime error , showing SIGHUP
How to solve plz help

My code

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.util.Scanner;

/* Name of the class has to be "Main" only if the class is public. */
class Codechef
	public static void main (String[] args) throws java.lang.Exception
	    int x , y , z;
	    Scanner sc= new Scanner(;
	    int t = sc.nextInt();
	    while(t>0) {
	        x = sc.nextInt();
	        y = sc.nextInt();
	        z = sc.nextInt();
		// your code goes here

Learning course: Basic Math using Java
Problem Link: CodeChef: Practical coding for everyone

you have an infinite loop:


should be: