Problem C HDU 5224

Source: Internet
Author: User

Description

There is a piece of paper in front of Tom, it length and width are integers. Tom knows the area of this paper, he wants to know the minimum perimeter of this paper.

Input

In the first line, there are an integer T indicates the number of test cases. In the next T-lines, there is only one of the integer-n-Every line, indicates the area of paper.
t\leq 10,n\leq {10}^{9}

Output

For each case, output a integer, indicates the answer.

Sample Input

32712

Sample Output

61614
#include<iostream>#include<cstdio>#include<cmath>#include<algorithm>UsingNamespace Std;IntMain(){int T, S;Double m;scanf("%d", &t);While(t--){int xYC;int Mini=1e9;scanf("%d", &s); m=(Double)sqrt(s);For(x=1; x<=m; x++){If(s%x==0) {y=s/x;c= (X+y2 ;mini=min (c< Span class= "Sh-symbol" >,mini); }}printf (  "%d\n" }}          /span>                

Problem C HDU 5224

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.