Codeforces Round #655 (Div. 2) A. Omkar and Completion(构造)

You have been blessed as a child of Omkar. To express your gratitude, please solve this problem for Omkar!

An array aa of length nn is called complete if all elements are positive and don't exceed 10001000 , and for all indices xx ,yy ,zz (1≤x,y,zn1≤x,y,z≤n ), ax+ayazax+ay≠az (not necessarily distinct).

You are given one integer nn . Please find any complete array of length nn . It is guaranteed that under given constraints such array exists.

Input

Each test contains multiple test cases. The first line contains tt (1≤t≤10001≤t≤1000 )  — the number of test cases. Description of the test cases follows.

The only line of each test case contains one integer nn (1≤n≤10001≤n≤1000 ).

It is guaranteed that the sum of nn over all test cases does not exceed 10001000 .

Output

For each test case, print a complete array on a single line. All elements have to be integers between 11 and 10001000 and for all indices xx ,yy ,zz (1≤x,y,zn1≤x,y,z≤n ) (not necessarily distinct), ax+ayazax+ay≠az must hold.

If multiple solutions exist, you may print any.

Example

Input

Copy

2

5

4

Output

Copy

1 5 3 77 12

384 384 44 44

 

构造一下,1 3 1 3 1 3…这样即可。

复制代码
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int t;
    cin >> t;
    while(t--)
    {
        int n;
        cin >> n;
        for(int i = 1; i <= n; i++)
        {
            if(i & 1) cout << 1 << ' ';
            else cout << 3 << ' ';
        }
        cout << endl;
    }
    return 0;
}
复制代码

 

posted @   脂环  阅读(336)  评论(0编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
点击右上角即可分享
微信分享提示
主题色彩