{"problem":{"name":"F. AND-permutations","description":{"content":"Given an integer _N_, find two permutations: 1.  Permutation _p_ of numbers from 1 to _N_ such that _p__i_ ≠ _i_ and _p__i_ & _i_ = 0 for all _i_ = 1, 2, ..., _N_. 2.  Permutation _q_ of numbers from","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF909F"},"statements":[{"statement_type":"Markdown","content":"Given an integer _N_, find two permutations:\n\n1.  Permutation _p_ of numbers from 1 to _N_ such that _p__i_ ≠ _i_ and _p__i_ & _i_ = 0 for all _i_ = 1, 2, ..., _N_.\n2.  Permutation _q_ of numbers from 1 to _N_ such that _q__i_ ≠ _i_ and _q__i_ & _i_ ≠ 0 for all _i_ = 1, 2, ..., _N_.\n\n& is the [bitwise AND operation](https://en.wikipedia.org/wiki/Bitwise_operation#AND).\n\n## Input\n\nThe input consists of one line containing a single integer _N_ (1 ≤ _N_ ≤ 105).\n\n## Output\n\nFor each subtask, if the required permutation doesn't exist, output a single line containing the word \"_NO_\"; otherwise output the word \"_YES_\" in the first line and _N_ elements of the permutation, separated by spaces, in the second line. If there are several possible permutations in a subtask, output any of them.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"给定一个整数 $N$，找到两个排列：\n\n$\\&$ 是按位与运算。\n\n输入包含一行，包含一个整数 $N$（$1 ≤ N ≤ 10^5$）。\n\n对于每个子任务，如果所需的排列不存在，则输出一行包含单词 \"_NO_\"；否则在第一行输出单词 \"_YES_\"，并在第二行输出排列的 $N$ 个元素，元素之间用空格分隔。如果某个子任务存在多个可能的排列，输出任意一个即可。\n\n## Input\n\n输入包含一行，包含一个整数 $N$（$1 ≤ N ≤ 10^5$）。\n\n## Output\n\n对于每个子任务，如果所需的排列不存在，则输出一行包含单词 \"_NO_\"；否则在第一行输出单词 \"_YES_\"，并在第二行输出排列的 $N$ 个元素，元素之间用空格分隔。如果某个子任务存在多个可能的排列，输出任意一个即可。\n\n[samples]","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ N \\in \\mathbb{Z} $ with $ 1 \\leq N \\leq 10^5 $.  \nLet $ P = (p_1, p_2, \\dots, p_N) $ be a permutation of $ \\{1, 2, \\dots, N\\} $.  \n\n**Constraints**  \nFind two permutations $ P_1 $ and $ P_2 $ of $ \\{1, 2, \\dots, N\\} $ such that:  \n$$ p_{1,i} \\& p_{2,i} = c_i \\quad \\text{for all } i \\in \\{1, \\dots, N\\} $$  \nfor some specified sequence $ c = (c_1, \\dots, c_N) $ — **but no such $ c $ is provided in the input**.  \n\n**Objective**  \nGiven only $ N $, output:  \n- \"_NO_\" if no pair of permutations $ (P_1, P_2) $ exists satisfying an implicit condition (unspecified).  \n- \"_YES_\" followed by any valid $ P_1 $ and $ P_2 $ if such a pair exists.  \n\n**Note**: The problem statement is incomplete — the target bitwise AND values $ c_i $ are not given. Without them, the condition is ill-defined.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF909F","tags":["constructive algorithms"],"sample_group":[["3","NO\nNO"],["6","YES\n6 5 4 3 2 1 \nYES\n3 6 2 5 1 4"]],"created_at":"2026-03-03 11:00:39"}}