fork download
  1. import java.io.*;
  2. import java.util.*;
  3.  
  4. public class Solution {
  5.  
  6. public static void main(String[] args) {
  7. Scanner input = new Scanner(System.in);
  8. int testCase = input.nextInt();
  9. for(int i=0;i<testCase;i++)
  10. {
  11. int data = input.nextInt();
  12. if(data%2==0)
  13. {
  14. System.out.println(data/2);
  15. }
  16. else if(data!=1)
  17. {
  18. System.out.println((data/2)+1);
  19. }
  20. else
  21. {
  22. System.out.println("0");
  23. }
  24. }
  25. /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
  26. }
  27. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
4
1
2
3
4
compilation info
Main.java:4: error: class Solution is public, should be declared in a file named Solution.java
public class Solution {
       ^
1 error
stdout
Standard output is empty