A. Ideal Generator
Source: codeforces
Difficulty: 800
Tags: math

We call an array $a$, consisting of $k$ positive integers, palindromic if $[a_1, a_2, \dots, a_k] = [a_k, a_{k-1}, \dots, a_1]$. For example, the arrays $[1, 2, 1]$ and $[5, 1, 1, 5]$ are palindromic, while the arrays $[1, 2, 3]$ and $[21, 12]$ are not.
We call a number $k$ an ideal generator if any integer $n$ ($n \ge k$) can be represented as the sum of the elements of a palindromic array of length exactly $k$. Each element of the array must be greater than $0$.
For example, the number $1$ is an ideal generator because any natural number $n$ can be generated using the array $[n]$. However, the number $2$ is not an ideal generator — there is no palindromic array of length $2$ that sums to $3$.
Determine whether the given number $k$ is an ideal generator.

-----Input-----
The first line of the input contains one integer $t$ ($1 \le t \le 1000$) — the number of test cases.
The first and only line of each test case contains one integer $k$ ($1 \le k \le 1000$).

-----Output-----
For each number $k$, you need to output the word "YES" if it is an ideal generator, or "NO" otherwise.
You may output "Yes" and "No" in any case (for example, the strings "yES", "yes", and "Yes" will be recognized as a positive answer).

-----Examples-----
Input:
5
1
2
3
73
1000
Output:
YES
NO
YES
YES
NO

C++ solution:
#include <iostream>

using namespace std;

int main() {
    int t;
    cin >> t;
    while (t--) {
        int k;
        cin >> k;
        // A number k is an ideal generator if and only if it's odd
        if (k % 2 == 1) {
            cout << "YES\n";
        } else {
            cout << "NO\n";
        }
    }
    return 0;
}

Go solution:
package main

import (
	"fmt"
	"bufio"
	"os"
	"strconv"
	"strings"
)

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	
	// Read number of test cases
	scanner.Scan()
	t, _ := strconv.Atoi(scanner.Text())

	for i := 0; i < t; i++ {
		scanner.Scan()
		input := strings.TrimSpace(scanner.Text())
		k, err := strconv.Atoi(input)
		if err != nil {
			fmt.Println("NO")
			continue
		}

		if k%2 == 1 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

Java solution:
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();
        for (int i = 0; i < t; i++) {
            if (scanner.hasNextInt()) {
                int k = scanner.nextInt();
                if (k % 2 == 1) {
                    System.out.println("YES");
                } else {
                    System.out.println("NO");
                }
            } else {
                System.out.println("NO");
            }
        }
        scanner.close();
    }
}

JavaScript solution:
const readline = require('readline');

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

let input = [];
let currentLine = 0;

rl.on('line', (line) => {
    input.push(line);
}).on('close', () => {
    const t = parseInt(input[0]);
    for (let i = 1; i <= t; i++) {
        const k = parseInt(input[i]);
        console.log(k % 2 === 1 ? "YES" : "NO");
    }
    rl.close();
});

Python solution:
for i in range(int(input())):
    print("YES" if int(input())%2==1 else "NO")

Ruby solution:
input = $stdin.read.split.map(&:to_i)
t = input.shift
t.times do
  k = input.shift
  puts k.odd? ? "YES" : "NO"
end