QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 1024 MB Total points: 100 Hackable ✓

#14220. 基因块

Statistics

Block Trade

你发现你可以轻易地用一个大小为 $N$ 的大泥土块来兑换 Minecraft 中最稀有的方块之一——Gene 方块。尽管在这个服务器中泥土块极其丰富,但它们有着不同的尺寸。经过仔细观察,你发现每个独立泥土块的尺寸总是以 7 结尾的正整数,即 7, 17, 27 等。要兑换 Gene 方块,你最少需要多少个泥土块(使得它们的尺寸之和恰好为 $N$)?

输入格式

第一行包含一个整数 $1 \le t \le 405$,表示测试用例的数量。

每个测试用例占一行,包含一个整数 $0 < N \le 10^9$,表示你需要制作的大泥土块的尺寸,以便兑换 Gene 方块。

输出格式

对于每个测试用例,输出一行,包含一个整数,表示兑换 Gene 方块所需的最少泥土块数量。如果无法兑换,则输出 -1。

样例

输入样例 1

3
84
85
106054

输出样例 1

2
5
2

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.