{"problem":{"name":"Increasing LCMs","description":{"content":"We have a sequence of $N$ positive integers: $A_1,A_2,\\cdots,A_N$. You are to rearrange these integers into another sequence $x_1,x_2,\\cdots,x_N$, where $x$ must satisfy the following condition: *   ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc122_e"},"statements":[{"statement_type":"Markdown","content":"We have a sequence of $N$ positive integers: $A_1,A_2,\\cdots,A_N$. You are to rearrange these integers into another sequence $x_1,x_2,\\cdots,x_N$, where $x$ must satisfy the following condition:\n\n*   Let us define $y_i=\\operatorname{LCM}(x_1,x_2,\\cdots,x_i)$, where the function $\\operatorname{LCM}$ returns the least common multiple of the given integers. Then, $y$ is strictly increasing. In other words, $y_1<y_2<\\cdots<y_N$ holds.\n\nDetermine whether it is possible to form a sequence $x$ satisfying the condition, and show one such sequence if it is possible.\n\n## Constraints\n\n*   $1 \\leq N \\leq 100$\n*   $2 \\leq A_1 < A_2 \\cdots < A_N \\leq 10^{18}$\n*   All values in input are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\cdots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc122_e","tags":[],"sample_group":[["3\n3 4 6","Yes\n3 6 4\n\nFor $x=(3,6,4)$, we have:\n\n*   $y_1=\\operatorname{LCM}(3)=3$\n*   $y_2=\\operatorname{LCM}(3,6)=6$\n*   $y_3=\\operatorname{LCM}(3,6,4)=12$\n\nHere, $y_1<y_2<y_3$ holds."],["3\n2 3 6","No\n\nNo permutation of $A$ would satisfy the condition."],["10\n922513 346046618969 3247317977078471 4638516664311857 18332844097865861 81706734998806133 116282391418772039 134115264093375553 156087536381939527 255595307440611247","Yes\n922513 346046618969 116282391418772039 81706734998806133 255595307440611247 156087536381939527 134115264093375553 18332844097865861 3247317977078471 4638516664311857"]],"created_at":"2026-03-03 11:01:14"}}