Language: C++

import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.NavigableMap;
import java.util.NavigableSet;
import java.util.Optional;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.stream.Collectors;

class Main {

    private static PrintWriter out;

    private static void mprintln(Object... ar) {
        for (Object i : ar) {
            out.print(i + " ");
        }
        out.println();
    }

    public static void main(String[] args) throws FileNotFoundException {

        // Input from file
        // File inputFile = new File("JavaFile.txt");
        // File outputFile = new File("JavaOutputFile.txt");
        // FileReader fileReader = new FileReader(inputFile);
        // Here it ends

        MyScanner sc = new MyScanner();
        // MyScanner sc = new MyScanner(fileReader);

        out = new PrintWriter(new BufferedOutputStream(System.out)); // Output to console
        // out = new PrintWriter(new PrintStream(outputFile)); // Output to file

        getAns(sc);

        out.close();
    }

    /*
     *Don't use builtin function (Math.ceil)
     */

    static final long MOD = (long) (1e9 + 7);

    private static void getAns(MyScanner sc) {
        int n = sc.ni();

        out.println((double) (n + 1 >> 1) / n);
    }

    static class MyScanner {

        BufferedReader br;
        StringTokenizer st;

        MyScanner(FileReader fileReader) {
            br = new BufferedReader(fileReader);
        }

        MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String nn() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        String nextLine() {
            String ans = "";
            try {
                ans = br.readLine();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
            return ans;
        }

        char nc() {
            return nn().charAt(0);
        }

        int ni() {
            return Integer.parseInt(nn());
        }

        long nl() {
            return Long.parseLong(nn());
        }

        double nd() {
            return Double.parseDouble(nn());
        }

        int[] niArr0(int n) {
            int[] ar = new int[n];
            for (int i = 0; i < n; i++) {
                ar[i] = ni();
            }
            return ar;
        }

        int[] niArr1(int n) {
            int[] ar = new int[n + 1];
            for (int i = 1; i <= n; i++) {
                ar[i] = ni();
            }
            return ar;
        }

        Long[] nlArr0(int n) {
            Long[] ar = new Long[n];
            for (int i = 0; i < n; i++) {
                ar[i] = nl();
            }
            return ar;
        }

        Long[] nlArr1(int n) {
            Long[] ar = new Long[n + 1];
            for (int i = 1; i <= n; i++) {
                ar[i] = nl();
            }
            return ar;
        }
    }
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.BufferedOutputStream;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.BufferedReader;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
    3 | import java.io.FileNotFoundException;
      | ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
    4 | import java.io.FileReader;
      | ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
    5 | import java.io.IOException;
      | ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
    6 | import java.io.InputStreamReader;
      | ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: 'import' does not name a type
    7 | import java.io.PrintWriter;
      | ^~~~~~
a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:8:1: error: 'import' does not name a type
    8 | import java.util.ArrayList;
      | ^~~~~~
a.cc:8:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:9:1: error: 'import' does not name a type
    9 | import java.util.Arrays;
      | ^~~~~~
a.cc:9:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:10:1: error: 'import' does not name a type
   10 | import java.util.Collections;
      | ^~~~~~
a.cc:10:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:11:1: error: 'import' does not name a type
   11 | import java.util.Comparator;
      | ^~~~~~
a.cc:11:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:12:1: error: 'import' does not name a type
   12 | import java.util.HashMap;
      | ^~~~~~
a.cc:12:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:13:1: error: 'import' does not name a type
   13 | import java.util.HashSet;
      | ^~~~~~
a.cc:13:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:14:1: error: 'import' does not name a type
   14 | import java.util.LinkedHashMap;
      | ^~~~~~
a.cc:14:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:15:1: error: 'import' does not name a type
   15 | import java.util.LinkedList;
      | ^~~~~~
a.cc:15:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:16:1: error: 'import' does not name a type
   16 | import java.util.List;
      | ^~~~~~
a.cc:16:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:17:1: error: 'import' does not name a type
   17 | import java.util.Map;
      | ^~~~~~
a.cc:17:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:18:1: error: 'import' does not name a type
   18 | import java.util.NavigableMap;
      | ^~~~~~
a.cc:18:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:19:1: error: 'import' does not name a type
   19 | import java.util.NavigableSet;
      | ^~~~~~
a.cc:19:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:20:1: error: 'import' does not name a type
   20 | import java.util.Optional;
      | ^~~~~~
a.cc:20:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:21:1: error: 'import' does not name a type
   21 | import java.util.PriorityQueue;
      | ^~~~~~
a.cc:21:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:22:1: error: 'import' does not name a type
   22 | import java.util.Queue;
      | ^~~~~~
a.cc:22:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:23:1: error: 'import' does not name a type
   23 | import java.util.Random;
      | ^~~~~~
a.cc:23:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:24:1: error: 'import' does not name a type
   24 | import java.util.StringTokenizer;
      | ^~~~~~
a.cc:24:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:25:1: error: 'import' does not name a type
   25 | import java.util.TreeMap;
      | ^~~~~~
a.cc:25:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:26:1: error: 'import' does not name a type
   26 | import java.util.TreeSet;
      | ^~~~~~
a.cc:26:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:27:1: error: 'import' does not name a type
   27 | import java.util.stream.Collectors;
      | ^~~~~~
a.cc:27:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:31:12: error: expected ':' before 'static'
   31 |     private static PrintWriter out;
      |            ^~~~~~~
      |            :
a.cc:31:20: error: 'PrintWriter' does not name a type
   31 |     private static PrintWriter out;
      |                    ^~~~~~~~~~~
a.cc:33:12: error: expected ':' before 'static'
   33 |     private static void mprintln(Object... ar) {
      |            ^~~~~~~
      |            :
a.cc:33:34: error: 'Object' has not been declared
   33 |     private static void mprintln(Object... ar) {
      |                                  ^~~~~~
a.cc:33:44: error: expansion pattern 'int' contains no parameter packs
   33 |     private static void mprintln(Object... ar) {
      |                                            ^~
a.cc:40:11: error: expected ':' before 'static'
   40 |     public static void main(String[] args) throws FileNotFoundException {
      |           ^~~~~~~
      |           :
a.cc:40:29: error: 'String' has not been declared
   40 |     public static void main(String[] args) throws FileNotFoundException {
      |                             ^~~~~~
a.cc:40:38: error: expected ',' or '...' before 'args'
   40 |     public static void main(String[] args) throws FileNotFoundException {
      |                                      ^~~~
a.cc:40:42: error: expected ';' at end of member declaration
   40 |     public static void main(String[] args) throws FileNotFoundException {
      |                                          ^
      |                                           ;
a.cc:40:44: error: 'throws' does not name a type
   40 |     public static void main(String[] args) throws FileNotFoundException {
      |                                            ^~~~~~
a.cc:63:12: error: 'final' does not name a type
   63 |     static final long MOD = (long) (1e9 + 7);
      |            ^~~~~
a.cc:65:12: error: expected ':' before 'static'
   65 |     private static void getAns(MyScanner sc) {
      |            ^~~~~~~
      |            :
a.cc:65:32: error: 'MyScanner' has not been declared
   65 |     private static void getAns(MyScanner sc) {
      |                                ^~~~~~~~~
a.cc:73:9: error: 'BufferedReader' does not name a type
   73 |         BufferedReader br;
      |         ^~~~~~~~~~~~~~
a.cc:74:9: error: 'StringTokenizer' does not name a type
   74 |         StringTokenizer st;
      |         ^~~~~~~~~~~~~~~
a.cc:76:29: error: expected ')' before 'fileReader'
   76 |         MyScanner(FileReader fileReader) {
      |                  ~          ^~~~~~~~~~~
      |                             )
a.cc:84:9: error: 'String' does not name a type
   84 |         String nn() {
      |         ^~~~~~
a.cc:95:9: error: 'String' does not name a type
   95 |         String nextLine() {
      |         ^~~~~~
a.cc:121:12: error: expected unqualified-id before '[' token
  121 |         int[] niArr0(int n) {
      |            ^
a.cc:129:12: error: expected unqualified-id before '[' token
  129 |         int[] niArr1(int n) {
      |            ^
a.cc:137:9: error: 'Long' does not name a type; did you mean 'long'?
  137 |         Long[] nlArr0(int n) {
      |         ^~~~
      |         long
a.cc:145:9: error: 'Long' does not name a type; did you mean 'long'?
  145 |         Long[] nlArr1(int n) {
      |         ^~~~
      |         long
a.cc:152:6: error: expected ';' after class definition
  152 |     }
      |      ^
      |      ;
a.cc:71:5: error: a storage class can only be specified for objects and functions
   71 |     static class MyScanner {
      |     ^~~~~~
a.cc:153:2: error: expected ';' after class definition
  153 | }
      |  ^
      |  ;
a.cc: In static member function 'static void Main::mprintln(...)':
a.cc:34:14: error: 'Object' was not declared in this scope
   34 |         for (Object i : ar) {
      |              ^~~~~~
a.cc:37:9: error: 'out' was not declared in this scope
   37 |         out.println();
      |         ^~~
a.cc:38:5: error: expected primary-expression before '}' token
   38 |     }
      |     ^
a.cc:38:5: error: expected ')' before '}' token
a.cc:34:13: note: to match this '('
   34 |         for (Object i : ar) {
      |             ^
a.cc:38:5: error: expected primary-expression before '}' token
   38 |     }
      |     ^
a.cc: In static member function 'static void Main::getAns(int)':
a.cc:66:20: error: request for member 'ni' in 'sc', which is of non-class type 'int'
   66 |         int n = sc.ni();
      |                    ^~
a.cc:68:9: error: 'out' was not declared in this scope
   68 |         out.println((double) (n + 1 >> 1) / n);
      |         ^~~
a.cc: In constructor 'Main::MyScanner::MyScanner()':
a.cc:81:13: error: 'br' was not declared in this scope
   81 |             br = new BufferedReader(new InputStreamReader(System.in));
      |             ^~
a.cc:81:22: error: expected type-specifier before 'BufferedReader'
   81 |             br = new BufferedReader(new InputStreamReader(System.in));
      |                      ^~~~~~~~~~~~~~
a.cc: In member function 'char Main::MyScanner::nc()':
a.cc:106:20: error: 'nn' was not declared in this scope; did you mean 'nc'?
  106 |             return nn().charAt(0);
      |                    ^~
      |                    nc
a.cc: In member function 'int Main::MyScanner::ni()':
a.cc:110:20: error: 'Integer' was not declared in this scope
  110 |             return Integer.parseInt(nn());
      |                    ^~~~~~~
a.cc:110:37: error: 'nn' was not declared in this scope; did you mean 'nc'?
  110 |             return Integer.parseInt(nn());
      |                                     ^~
      |                                     nc
a.cc: In member function 'long int Main::