QOJ.ac

QOJ

시간 제한: 1.0 s 메모리 제한: 1024 MB 총점: 100

#17995. GATA-CAT

통계

一个 DNA 序列是由四种碱基组成的分子链:胞嘧啶(C)、鸟嘌呤(G)、腺嘌呤(A)和胸腺嘧啶(T)。这些字母可以用来将基因序列编码为文本。

此前,我们假设猫科动物的特征取决于我们所说的 CAT 度数。它是指其基因序列中按此顺序包含碱基 C-A-T(忽略它们之间的其他碱基)的次数。例如,序列 “GACT”、“GCAT” 和 “CCGAAGT” 的 CAT 度数分别为 0、1 和 4。

事实证明,这只是冰山一角。来自拉丁美洲的研究人员惊讶地发现,一些健康的猫的 CAT 度数低于平均水平。经过进一步研究,他们确定了调节猫科动物特征的第二个因素,现在被称为 GATA 度数。与 CAT 度数类似,它是指基因序列中按此顺序包含碱基 G-A-T-A(忽略它们之间的其他碱基)的次数。

今天,你将在实验室中合成全新的 DNA 序列。我们将要求你构建具有特定 GATA 和 CAT 度数的短基因序列(最多 500 个碱基)。请编写一个程序来辅助我们的研究。

输入格式

第一行包含一个整数 $Q$($1 \le Q \le 1000$),表示需要构建的序列数量。

接下来的 $Q$ 行,每行包含两个整数 $G$ 和 $C$($0 \le G, C \le 10^6$),分别表示要求的 GATA 度数和 CAT 度数。

输出格式

对于输入中的每个请求,输出一行,包含一个长度不超过 500 且非空的字符串,仅由大写字母 “C”、“G”、“A” 或 “T” 组成,并具有指定的 GATA 和 CAT 度数。

可以证明,在给定的约束条件下,一定存在合法的解。如果存在多个解,输出其中任意一个即可;不需要使字符串的长度最小。

样例

输入样例 1

4
1 1
2 3
18 1
2 1

输出样例 1

CGATA
ATGGCATATC
GGAAATTTCAT
GATACAT

输入样例 2

5
1 0
0 1
1 1
0 0
0 0

输出样例 2

GATA
CAT
CGATA
T
TTTTTTTTTTT

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.