QOJ.ac

QOJ

時間限制: 2 s 記憶體限制: 1024 MB 總分: 100 可 Hack ✓

#17941. 초콜릿과 11과 팰린드롬

统计

Coco 拥有许多印有数字 $0$ 到 $9$ 的巧克力。Coco 想用这些巧克力拼出一个大数送给 Hanbyul。

Coco 知道 Hanbyul 喜欢回文数,尤其是 $11$,因此她想制作一个既是 $11$ 的倍数又是回文数的数。回文数是指从左往右读和从右往左读完全相同的数。例如,$9$、$11$、$4774$、$13531$ 是回文数,而 $1232$、$1100$ 不是。

请帮助 Coco 找到一个既是 $11$ 的倍数又是回文数的 $N$ 位非负整数。假设每种数字的巧克力都有足够多。除 $0$ 本身外,数不能以数字 $0$ 开头。

输入格式

第一行包含测试用例的数量 $T$。$(1 \le T \le 100)$

对于每个测试用例,在一行中给出一个正整数 $N$。$(1 \le N \le 10\,000)$

输出格式

对于每个测试用例,在一行中输出一个既是 $11$ 的倍数又是回文数的 $N$ 位非负整数。如果存在多个满足条件的数,输出其中任意一个即可。如果不存在这样的数,则输出 -1

样例

输入样例 1

2
4
9

输出样例 1

1331
123444321

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.