My issue
Plz help to resolve error
My code
import java.util.*;
import java.lang.*;
import java.io.*;
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner scanner = new Scanner(System.in);
long T = scanner.nextInt(); // Read the number of test cases
for (long i = 0; i < T; i++) {
long N = scanner.nextLong(); // Read N
double sqrtN = Math.sqrt(N);
long result =0 ;
if (N % 2 == 1) { // Odd N
result = (long)(sqrtN)+1 ; // Round up to nearest integer
}else{
result=(long)(sqrtN);}
result /= 2;
System.out.println(result);
}
}
}
Problem Link: Chef Product Practice Coding Problem - CodeChef