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

---
{"category_name":"easy","problem_code":"MINSZ","problem_name":"Minimise the Size","problemComponents":{"constraints":"- $1 \\leq T \\leq 10^5$\n- $0 \\leq C \\lt 2^{60}$\n- It is guaranteed in the input that sum of lengths of arrays over all testcases does not exceed $10^6$.","constraintsState":true,"subtasks":"","subtasksState":false,"inputFormat":"- First line will contain $T$, number of testcases. Then the testcases follow.\n- Each testcase contains single integer $C$ on a single line.\n","inputFormatState":true,"outputFormat":"- For each testcase, on the first line output the minimum possible size of array $A$ satisfying the given property.\n- On the next line output the elements of array $A$ in any order. \n","outputFormatState":true,"sampleTestCases":{"0":{"id":1,"input":"3\n1\n2\n3","output":"1\n1\n2\n1 3\n1\n3\n","explanation":"$\\textbf{Test case}$ 1: $C=1$, $A$ can be $\\{1\\}$\n\n$\\textbf{Test case}$ 2: $C=2$, $A$ can be $\\{1,3\\}$\n\n$\\textbf{Test case}$ 3: $C=3$, $A$ can be $\\{3\\}$","isDeleted":false}}},"video_editorial_url":"https://youtu.be/mjTvSPxN2Vo","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":"inov_360","problem_tester":"","date_added":"7-10-2021","tags":{"0":"bitwise","1":"easy","2":"inov_360","3":"start15"},"problem_difficulty_level":"Unavailable","best_tag":"Bitwise Xor","editorial_url":"https://discuss.codechef.com/problems/MINSZ","time":{"view_start_date":1634060704,"submit_start_date":1634060704,"visible_start_date":1634060704,"end_date":1735669800},"is_direct_submittable":false,"problemDiscussURL":"https://discuss.codechef.com/search?q=MINSZ","is_proctored":false,"visitedContests":{},"layout":"problem"}
---
Consider an array $A = \{a_1, a_2,...,a_n\}$ of size $n \geq 1$. If $a_k = 2^x -1$ for all $ 1\leq k \leq n$,  for some integer $x$ $(1 \leq x \leq 60)$, then $A$ is called $interesting$ $array$.

You are given a number $C$. Find any $interesting$ $array$ $A$ of minimum possible size such that $ a_1 \bigoplus a_2 \bigoplus...\bigoplus a_n = C$, where $\bigoplus$ represents bitwise XOR operation.

If there exists multiple such arrays, output any one.
<aside style='background: #f8f8f8;padding: 10px 15px;'><div>All submissions for this problem are available.</div></aside>