CF1250F.Data Center
入门
通过率:0%
时间限制:2.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
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?
你正在开发一个新建数据中心的项目。该数据中心将是一个矩形,面积恰好为 n 平方米,且其每条边的长度都必须是整数。
你的目标是尽量减小外部环境对数据中心的影响。因此,你希望最小化数据中心的周长(即其四条边长度之和)。
若数据中心为面积恰好为 n 平方米的矩形,且所有边长均为整数,则其最小可能周长是多少?
输入格式
The first and only line of the input contains an integer n (1≤n≤105), where n is the area of the data center in square meters.
输入仅有一行,包含一个整数 n(1≤n≤105),其中 n 表示数据中心的面积(单位:平方米)。
输出格式
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×6 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×13 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×1 square. Its area is 1 and the perimeter is 1+1+1+1=4.
在第一个例子中,数据中心所需的形状是一个 6×6 的正方形。其面积为 36,周长为 6+6+6+6=24。
在第二个例子中,数据中心所需的形状是一个 1×13 的矩形。其面积为 13,周长为 1+13+1+13=28。
在第三个例子中,数据中心所需的形状是一个 1×1 的正方形。其面积为 1,周长为 1+1+1+1=4。
输入解题思路,AI测评打分。不知道怎么写?