Help me in solving MONSTER1 problem

My issue

why it is showing runtime error

My code



import java.lang.*;
import java.io.*;
import java.util.*;/* 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
    {
        // your code goes here
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
       while(n>0){
            int x=sc.nextInt();
             int y=sc.nextInt();
              int z=sc.nextInt();
            if(y>z)
            {
                System.out.println(Math.abs(y-(x+z)));
            }
            else{
                System.out.println(0);
            }
            n--;
        }
    }
}

Learning course: Prepare for your DSA interviews
Problem Link: Practice Problem in - CodeChef

@nandasuvam2001
U have to use long instead of int
i have corrected your code

import java.lang.*;
import java.io.*;
import java.util.*;/* 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
    {
        // your code goes here
        Scanner sc=new Scanner(System.in);
        long n=sc.nextInt();
       while(n>0){
            long x=sc.nextLong();
             long y=sc.nextLong();
              long z=sc.nextLong();
            if(y>z)
            {
                System.out.println(1);
            }
            else{
                System.out.println(0);
            }
            n--;
        }
    }
}