Runtime error in JULKA, spoj code

It’s the same code as shown in the video. Could you check and tell me where I’m wrong? It’s showing runtime error in CB editor.

public static void calculate(BigInteger n, BigInteger k){//n -> sum

     BigInteger x,y;

     y = n.subtract(k);
     y = y.divide(BigInteger.valueOf(2));
     x = y.add(k);
     System.out.println(x);
     System.out.println(y);
}

public static void main (String[] args) throws java.lang.Exception
{
	Scanner scn = new Scanner(System.in);
	BigInteger totalApples, diffBwTwo, ans;
	int tests = 10;
	
	while(tests > 0){
	    totalApples = scn.nextBigInteger();
	    diffBwTwo = scn.nextBigInteger();
	    calculate(totalApples, diffBwTwo);
	    tests -= 1;
	}
}

https://ide.geeksforgeeks.org/duGkYUYf1O

are u giving valid input?

instead of running in ide direcltly submit on spoj and check

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.