16600번: Contemporary Art
At the Van Abbemuseum of modern and contemporary art in Eindhoven, we always look to present our muses in the most interesting way possible. Sometimes we have our work cut out for us. Today we are exploring whether we can modify one of our perfectly-square
www.acmicpc.net
SQRT
- 제목
Contemporary Art
- 조건
시간 제한 : 1 초
메모리 제한 : 512 MB
- 문제
At the Van Abbemuseum of modern and contemporary art in Eindhoven, we always look to present our muses in the most interesting way possible. Sometimes we have our work cut out for us.
Today we are exploring whether we can modify one of our perfectly- square picture frames (such as the one shown in Figure C.1) to include an electrical filament. The purpose of this filament is so that the image can set itself alight at some opportune and hilarious moment—for example, in the middle of a sale by auction.
You will be responsible for buying the filament to run around the entire perimeter of the artwork. How many centimetres will you need to obtain?
- 입력
The input consists of:
One line with an integer a (1 ≤ a ≤ 10^18), the area of the image in square centimetres.
- 출력
Output the total length of filament needed for the frame, in centimetres. Your answer should have an absolute or relative error of at most 10^−6.
예제 입력1 | 예제 출력1 |
64 | 32.0 |
예제 입력2 | 예제 출력2 |
1234 | 140.51334456 |
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
#define fastio ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define endl '\n'
int main() {
fastio;
cout << fixed;
cout.precision(6);
double x;
cin >> x;
cout << sqrt(x) * 4 << endl;
return 0;
}
'Problem Solving > BaekJoon' 카테고리의 다른 글
[BOJ/백준] 25099 - Anagram (0) | 2022.09.15 |
---|---|
[BOJ/백준] 1407 - 2로 몇 번 나누어질까 (0) | 2022.09.15 |
[BOJ/백준] 25427 - DKSH를 찾아라 (0) | 2022.09.13 |
[BOJ/백준] 2623 - 음악프로그램 (0) | 2022.09.13 |
[BOJ/백준] 1922 - 네트워크 연결 (0) | 2022.09.12 |