fork download
  1. import java.io.BufferedReader;
  2. import java.io.InputStreamReader;
  3. import java.io.IOException;
  4.  
  5. class CupCakes
  6. {
  7. public static void main(String args[]) throws IOException
  8. {
  9. int t = Integer.parseInt(br.readLine());
  10. if(t>1000 && t<1)
  11. System.exit(1);
  12. for(int i = 0; i<t; i++)
  13. {
  14. long n = Long.parseLong(br.readLine());
  15. if(n>=2 && n<=100000000)
  16. System.out.println((n/2)+1);
  17. }
  18. }
  19. }
Success #stdin #stdout 0.06s 380224KB
stdin
5
2
5
53
20
45
stdout
2
3
27
11
23