前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Codeforces Round #633 (Div. 2) A Filling Diamonds (假题,观察)

Codeforces Round #633 (Div. 2) A Filling Diamonds (假题,观察)

作者头像
glm233
发布2020-09-28 12:19:15
4700
发布2020-09-28 12:19:15
举报

Filling Diamonds

time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

You have integer nn. Calculate how many ways are there to fully cover belt-like area of 4n−24n−2 triangles with diamond shapes.

Diamond shape consists of two triangles. You can move, rotate or flip the shape, but you cannot scale it.

22 coverings are different if some 22 triangles are covered by the same diamond shape in one of them and by different diamond shapes in the other one.

Please look at pictures below for better understanding.

On the left you can see the diamond shape you will use, and on the right you can see the area you want to fill.

These are the figures of the area you want to fill for n=1,2,3,4n=1,2,3,4.

You have to answer tt independent test cases.

Input

The first line contains a single integer tt (1≤t≤1041≤t≤104) — the number of test cases.

Each of the next tt lines contains a single integer nn (1≤n≤1091≤n≤109).

Output

For each test case, print the number of ways to fully cover belt-like area of 4n−24n−2 triangles using diamond shape. It can be shown that under given constraints this number of ways doesn't exceed 10181018.

Example

input

代码语言:javascript
复制
2
2
1

output

代码语言:javascript
复制
2
1

Note

In the first test case, there are the following 22 ways to fill the area:

In the second test case, there is a unique way to fill the area:

思路:冷静下来,这是div2A题而已,一定是找规律的假题,我们观察到每一种新的方法唯一的不同之处就是竖放的菱形,就是n=1的那个图形,而n有n个不同位置的竖菱形,答案就是n

代码语言:javascript
复制
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rg register ll
#define inf 2147483647
#define lb(x) (x&(-x))
ll sz[200005],n;
template <typename T> inline void read(T& x)
{
    x=0;char ch=getchar();ll f=1;
    while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
    while(isdigit(ch)){x=(x<<3)+(x<<1)+(ch^48);ch=getchar();}x*=f;
}
inline ll query(ll x){ll res=0;while(x){res+=sz[x];x-=lb(x);}return res;}
inline void add(ll x,ll val){while(x<=n){sz[x]+=val;x+=lb(x);}}//第x个加上val
ll t;
int main() 
{
	cin>>t;
	for(int i=1;i<=t;i++)
	{
		ll x;
		cin>>x;
		cout<<x<<endl;
	}
    return 0;
    
}
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2020-04-13 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档