306774: CF1250F. Data Center

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Data Center

题意翻译

## 题目描述 你正在建造一个新的数据中心。数据中心是一个矩形,面积正好为$n$平方米。数据中心的每一侧都是整数。 你需要尽量减少外部环境对数据中心的影响。因此,数据中心的周长需要是最小的。 数据中心的最小周长是多少? ## 输入数据 输入仅一行,即$n$。 $( 1 \le n \le 10^5 )$ ## 输出数据 输出数据中心的最小周长。 ## 样例解释 **样例1**中,数据中心是一个$6 \times 6$的矩形,它的面积是$36$,它的周长是$6+6+6+6=24$。 **样例2**中,数据中心是一个$1 \times 13$的矩形,它的面积是$13$,它的周长是$1+13+1+13=28$。 **样例3**中,数据中心是一个$1 \times 1$的矩形,它的面积是$1$,它的周长是$1+1+1+1=4$。

题目描述

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?

输入输出格式

输入格式


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 $ .

Input

题意翻译

## 题目描述 你正在建造一个新的数据中心。数据中心是一个矩形,面积正好为$n$平方米。数据中心的每一侧都是整数。 你需要尽量减少外部环境对数据中心的影响。因此,数据中心的周长需要是最小的。 数据中心的最小周长是多少? ## 输入数据 输入仅一行,即$n$。 $( 1 \le n \le 10^5 )$ ## 输出数据 输出数据中心的最小周长。 ## 样例解释 **样例1**中,数据中心是一个$6 \times 6$的矩形,它的面积是$36$,它的周长是$6+6+6+6=24$。 **样例2**中,数据中心是一个$1 \times 13$的矩形,它的面积是$13$,它的周长是$1+13+1+13=28$。 **样例3**中,数据中心是一个$1 \times 1$的矩形,它的面积是$1$,它的周长是$1+1+1+1=4$。

加入题单

算法标签: