309379: CF1670D. Very Suspicious
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Very Suspicious
题意翻译
有一个**无穷大**的平面蜂巢,它由无数个正六边形拼接形成。 你可以在这个平面蜂巢画直线,满足这条直线平行于某个正六边形的某条边。直线和六边形的边能够围成正三角形。 每个正三角形内部不能有其它的直线和边存在 问: 构造**至少** $n$ 个正三角形至少需要多少条直线题目描述
Sehr Sus is an infinite hexagonal grid as pictured below, controlled by MennaFadali, ZerooCool and Hosssam. They love equilateral triangles and want to create $ n $ equilateral triangles on the grid by adding some straight lines. The triangles must all be empty from the inside (in other words, no straight line or hexagon edge should pass through any of the triangles). You are allowed to add straight lines parallel to the edges of the hexagons. Given $ n $ , what is the minimum number of lines you need to add to create at least $ n $ equilateral triangles as described? ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF1670D/5491a1c977b08c3202f038f487f2a32d813abedc.png)Adding two red lines results in two new yellow equilateral triangles.输入输出格式
输入格式
The first line contains a single integer $ t $ ( $ 1 \le t \le 10^5 $ ) — the number of test cases. Then $ t $ test cases follow. Each test case contains a single integer $ n $ ( $ 1 \le n \le 10^{9} $ ) — the required number of equilateral triangles.
输出格式
For each test case, print the minimum number of lines needed to have $ n $ or more equilateral triangles.
输入输出样例
输入样例 #1
4
1
2
3
4567
输出样例 #1
2
2
3
83