跳到正文

个人记录

minecraft

linzeyu2012约 1 分钟
原文
文章信息与版本

文章信息

发布
2026年1月28日
收录
2026年1月28日
更新
2026年11月11日
篇幅
约 1 分钟

版本

  1. v2当前
  2. v1
C++
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		if(n==3) cout<<"1 -10 6 6 -10 1\n";
		else{
			cout<<"1 ";
			for(int i=2;i<=2*n-1;i++){
				if(i&1) cout<<"-1 ";
				else cout<<"2 ";
			}
			cout<<3-n<<"\n";
		}
	}
	return 0;
}
原文