🏡 index : github.com/captn3m0/codechef.git

---
{"category_name":"easy","problem_code":"ODDSUM","problem_name":"Odd Sum","problemComponents":{"constraints":"- $1 \\leq T \\leq 10^6$\n- $1 \\leq N \\leq 10^9$","constraintsState":true,"subtasks":"- 30 points : $1 \\leq R \\leq 10000$\n- 70 points : $1 \\leq R \\leq 10^9$\n","subtasksState":false,"inputFormat":"- The first line contains $T$ - the number of test cases. Then the test cases follow.\n- The first line of each test case contains $N$ - the size of the array.\n","inputFormatState":true,"outputFormat":"For each test case, output on one line the smallest sum among all arrays satisfying the constraints.","outputFormatState":true,"sampleTestCases":{"0":{"id":1,"input":"1\n3","output":3,"explanation":"- **Test case $1$**: A possible array is $[1, 2, 0]$. $[1, 0, 0]$ is not valid because $0$ occurs twice in it; $[0, 1, 2]$ is not valid because the prefix sum until the first index is $0$, which is even. Another possible array is $[5, 2, 4]$.\n$[1, 2, 0]$ yields the sum $3$, and we can prove that there are no valid arrays that have sum less than $3$.","isDeleted":false}}},"video_editorial_url":"","languages_supported":{"0":"CPP14","1":"C","2":"JAVA","3":"PYTH 3.6","4":"CPP17","5":"PYTH","6":"PYP3","7":"CS2","8":"ADA","9":"PYPY","10":"TEXT","11":"PAS fpc","12":"NODEJS","13":"RUBY","14":"PHP","15":"GO","16":"HASK","17":"TCL","18":"PERL","19":"SCALA","20":"LUA","21":"kotlin","22":"BASH","23":"JS","24":"LISP sbcl","25":"rust","26":"PAS gpc","27":"BF","28":"CLOJ","29":"R","30":"D","31":"CAML","32":"FORT","33":"ASM","34":"swift","35":"FS","36":"WSPC","37":"LISP clisp","38":"SQL","39":"SCM guile","40":"PERL6","41":"ERL","42":"CLPS","43":"ICK","44":"NICE","45":"PRLG","46":"ICON","47":"COB","48":"SCM chicken","49":"PIKE","50":"SCM qobi","51":"ST","52":"SQLQ","53":"NEM"},"max_timelimit":1,"source_sizelimit":50000,"problem_author":"rahularya1","problem_tester":"","date_added":"20-10-2021","tags":{"0":"cook134","1":"rahularya1","2":"simple"},"problem_difficulty_level":"Unavailable","best_tag":"","editorial_url":"https://discuss.codechef.com/problems/ODDSUM","time":{"view_start_date":1635100202,"submit_start_date":1635100202,"visible_start_date":1635100202,"end_date":1735669800},"is_direct_submittable":false,"problemDiscussURL":"https://discuss.codechef.com/search?q=ODDSUM","is_proctored":false,"visitedContests":{},"layout":"problem"}
---
### Read problem statements in [Mandarin](https://www.codechef.com/download/translated/COOK134/mandarin/ODDSUM.pdf), [Bengali](https://www.codechef.com/download/translated/COOK134/bengali/ODDSUM.pdf), and [Russian](https://www.codechef.com/download/translated/COOK134/russian/ODDSUM.pdf) as well.

Given an integer $N$, consider all arrays $A$ of size $N$ such that:

- All the elements are non-negative and distinct.
- All prefix sums are odd. Formally, for all $i$ such that $1 \le i \le N$, $\sum_{j=1}^i A_i$ is odd.

Among all possible arrays $A$, output the smallest possible sum of the elements of the array.

**Note**: Since the Input/Output may be large, it is preferred to use fast I/O.
<aside style='background: #f8f8f8;padding: 10px 15px;'><div>All submissions for this problem are available.</div></aside>