Problem A. Problem A.Alkane

时间限制 3000 ms   内存限制 512 MB

In organic chemistry, an alkane is an acyclic saturated hydrocarbon. In other words, an alkane consists of hydrogen and carbon atoms arranged in a tree structure in which all the carbon-carbon bonds are single. Alkanes have the general chemical formula CnH2n+2.
In an alkane, each carbon atom has 4 bonds (either C-C or C-H), and each hydrogen atom is joined to one of the carbon atoms (so in a C-H bond). The number of carbon
atoms may be thought of as the size of the alkane.
Alkanes with more than 3 carbon atoms can be arranged in various different ways, forming structural isomers. The simplest isomer of an alkane is the one in which the carbon atoms are arranged in a single chain with no branches. This isomer is sometimes called the n-isomer. However the chain of carbon atoms may also be branched at one or more points. The number of possible isomers increases rapidly with the number of carbon atoms.
Moreover, we define an alkyl is an alkane missing one hydrogen. An acyclic alkyl has the general formula CnH2n+1. The defination of structural isomer of alkyls is similar to alkanes’.
Now you need to count the number of structural isomers of alkanes and alkyls of size n modulo 998244353.
 

输入数据

The first line of the input contains an integer T , denoting the number of test cases.
In each test case, there is a single integer n in one line, denoting the size of alkanes and alkyls.
1 ≤ T ≤ 100000, 1 ≤ n ≤ 100000
 

输出数据

For each test case, output one line contains two integers, denoting the number of structural isomers of alkanes and alkyls of size n modulo 998244353.
 

样例输入

复制
9
1
2
3
4
5
6
7
8
9

样例输出

复制
1 1
1 1
1 2
2 4
3 8
5 17
9 39
18 89
35 211

样例说明

 
  
 
 

提交

请先 登录

© 2025 FAQs Contact About