五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

CF 1809B - Points on Plane

2023-07-20 16:14 作者:您是打尖兒還是住店呢  | 我要投稿

You are given a two-dimensional plane, and you need to place n chips on it.

You can place a chip only at a point with integer coordinates. The cost of placing a chip at the point (x,y) is equal to |x|+|y| (where |a|

?is the absolute value of a).

The cost of placing n chips is equal to the maximum among the costs of each chip.

You need to place n chips on the plane in such a way that the Euclidean distance between each pair of chips is strictly greater than1, and the cost is the minimum possible.

Input

The first line contains one integer t (1≤t≤104) — the number of test cases. Next t cases follow.

The first and only line of each test case contains one integer n

?(1≤n≤1018) — the number of chips you need to place.


Output

For each test case, print a single integer — the minimum cost to place n chips if the distance between each pair of chips must be strictly greater than 1.

-------------------------------------

給你一個二維平面,你需要在上面放置 n 個芯片。

您只能將芯片放置在具有整數(shù)坐標的點上。 將籌碼放置在點 (x,y) 的成本等于 |x|+|y| (其中 |a|

? 是 a) 的絕對值。

放置n個芯片的成本等于每個芯片成本中的最大值。

你需要將n個芯片放置在平面上,使得每對芯片之間的歐氏距離嚴格大于1,并且成本盡可能最小。

輸入

第一行包含一個整數(shù) t (1≤t≤104) — 測試用例的數(shù)量。 接下來是t個案例。

每個測試用例的第一行也是唯一一行包含一個整數(shù) n

? (1≤n≤1018) — 您需要放置的芯片數(shù)量。


輸出

對于每個測試用例,打印一個整數(shù) - 如果每對芯片之間的距離必須嚴格大于 1,則放置 n 個芯片的最小成本。

------------------------------

我們舉個例子;

如果是5-9個就需要2個。

如果是10-16個就需要4個。

如果是n個,那么就看n的平方根正好是整數(shù)不是,如果是,--,如果不是,+1,然后輸出這個數(shù)-1的數(shù)。

有點繞啊。。我是越來越看不懂了。


CF 1809B - Points on Plane的評論 (共 條)

分享到微博請遵守國家法律
北宁市| 巴彦淖尔市| 开封市| 玉环县| 麟游县| 石柱| 衢州市| 余干县| 邵阳市| 通城县| 沙田区| 梨树县| 高碑店市| 桃园市| 昭觉县| 石泉县| 台江县| 东乡县| 饶河县| 鞍山市| 江川县| 蕲春县| 延寿县| 威宁| 双流县| 建瓯市| 香港 | 从化市| 郴州市| 南宫市| 边坝县| 石渠县| 郴州市| 大方县| 江山市| 宁都县| 嵩明县| 杭锦旗| 邻水| 五原县| 永和县|