QOJ.ac

QOJ

Límite de tiempo: 1.0 s Límite de memoria: 256 MB Puntuación total: 100

#11928. 苍鹭与他的三角形

Estadísticas

如果一个三角形的边长为连续整数 $t-1, t, t+1$,且其面积为整数,则称其为海伦三角形。现在,对于给定的 $n$,你需要找到一个与大于或等于 $n$ 的最小 $t$ 相关联的海伦三角形。

输入格式

输入包含多组测试数据。第一行是一个整数 $T$ ($1 \le T \le 30000$),随后有 $T$ 行。每行包含一个整数 $N$ ($1 \le N \le 10^{30}$)。

输出格式

对于每组测试数据,输出一行,包含最小的 $t$。如果不存在所要求的海伦三角形,则输出 $-1$。

样例

输入格式 1

4
1
2
3
4

输出格式 1

4
4
4
4

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.