Competitive Programming Solutions

GitHub
back to dashboard

F. Print Even Indices

Codeforces - Sheet #7 (Recursion) · limit: 1s · memory: 256MB · view on codeforces

input

4
1 4 2 7

output

2 1
Main.java
static void solve() {

        // Write your solution here
        int n = in.nextInt();
        int[] a = readIntArray(n);
        print(a, (n % 2 == 0) ? n - 2 : n - 1);
    }