A13034 | Data Center
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
You are developing a project to build a new data center. The data center will be a rectangle with an area of exactly $n$ square meters. Each side of the data center must be an integer.
Your goal is to minimize the impact of the external environment on the data center. For this reason, you want to minimize the length of the perimeter of the data center (that is, the sum of the lengths of its four sides).
What is the minimum perimeter of a rectangular data center with an area of exactly $n$ square meters, if the lengths of all its sides must be integers?
Your goal is to minimize the impact of the external environment on the data center. For this reason, you want to minimize the length of the perimeter of the data center (that is, the sum of the lengths of its four sides).
What is the minimum perimeter of a rectangular data center with an area of exactly $n$ square meters, if the lengths of all its sides must be integers?
输入格式
The first and only line of the input contains an integer $n$ ( $1 \le n \le 10^5$ ), where $n$ is the area of the data center in square meters.
输出格式
Print the required minimum perimeter in meters.
输入输出样例
输入 #1
36
输出 #1
24
输入 #2
13
输出 #2
28
输入 #3
1
输出 #3
4
In the first example, the required shape of the data center is $6\times6$ square. Its area is $36$ and the perimeter is $6+6+6+6=24$ .
In the second example, the required shape of the data center is $1\times13$ rectangle. Its area is $13$ and the perimeter is $1+13+1+13=28$ .
In the third example, the required shape of the data center is $1\times1$ square. Its area is $1$ and the perimeter is $1+1+1+1=4$ .
In the second example, the required shape of the data center is $1\times13$ rectangle. Its area is $13$ and the perimeter is $1+13+1+13=28$ .
In the third example, the required shape of the data center is $1\times1$ square. Its area is $1$ and the perimeter is $1+1+1+1=4$ .
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted