题目收集
题目列表题单
返回列表

Dominant Sequence

CodeforcesP0065· 1000ms· 256 MB· ZJU Summer 2026 Contest 6原题链接
构造

创建于 2026/07/18 · 更新于 2026/07/18

题目描述

You are given an integer nnn.

Your task is to construct a sequence of positive integers a1,a2,...,ana_1,a_2,...,a_na1​,a2​,...,an​ such that for every segment [l,r][l,r][l,r], there exists an index iii with l≤i≤rl \le i \le rl≤i≤r satisfying 2ai>al+al+1+...+ar2a_i \gt a_l+a_{l+1}+...+a_r2ai​>al​+al+1​+...+ar​.

In other words, every segment must contain an element which is strictly greater than half of the sum of this segment.

Additionally, every element of the sequence must not exceed 10910^9109.

It can be proven that under the given constraints, a valid sequence always exists.

输入格式

The first line contains one integer TTT (1≤T≤1041 \le T \le 10^41≤T≤104), denoting the number of test cases.

Each test case contains one integer nnn (1≤n≤1041 \le n \le 10^41≤n≤104).

It is guaranteed that the sum of nnn over all test cases does not exceed 10410^4104.

输出格式

For each test case, output nnn integers a1,a2,...,ana_1,a_2,...,a_na1​,a2​,...,an​.

The sequence must satisfy 1≤ai≤1091 \le a_i \le 10^91≤ai​≤109 for every iii.

For every segment [l,r][l,r][l,r], there must exist an index iii with l≤i≤rl \le i \le rl≤i≤r such that 2ai>al+al+1+...+ar2a_i \gt a_l+a_{l+1}+...+a_r2ai​>al​+al+1​+...+ar​.

If there are multiple valid answers, you may output any of them.

样例输入 #1

3
1
2
5

样例输出 #1

1
2 1
1 3 1 7 1