솔브닥 브론즈4
#include <iostream>
using namespace std;
int main()
{
double A, B;
cin >> A >> B;
cout.precision(10);
cout << fixed;
cout << A / B;
return 0;
}
//k에 값 대입해줄 때 (double) 안붙여줬다고 틀림
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int D, H, W;
double k;
cin >> D >> H >> W;
k = (double)(D*D) / ((H*H) + (W*W));
k = sqrt((double)k);
W = W * k;
H = H * k;
cout << (int)H << " " <<(int)W;
return 0;
}
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
long long N, M, result;
cin >> N >> M;
result = abs(N - M);
cout << result;
return 0;
}
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int A, B, C, result = 0;
int Max = 0;
cin >> A >> B >> C;
if (A == B && B==C)
{
//세개 다 같은 결과
result = 10000 + A * 1000;
}
else if (A == B)
{
//하나만 같은 결과
result = 1000 + A * 100;
}
else if (A == C)
{
result = 1000 + A * 100;
}
else if (B == C)
{
result = 1000 + B * 100;
}
else
{
//모두 다를 경우
if (A > B)
{
Max = A;
if (Max < C)
Max = C;
}
else
{
Max = B;
if (Max < C)
Max = C;
}
result = Max * 100;
}
cout << result;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int A, B, C, D;
cin >> A >> B >> C;
cin >> D;
C += D;
B += C / 60;
A += B / 60;
A %= 24;
B %= 60;
C %= 60;
cout << A << " " << B << " " << C;
return 0;
}
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int arr[3];
cin >> arr[0] >> arr[1] >> arr[2];
sort(arr, arr + 3);
cout << arr[0] << " " << arr[1] << " " << arr[2];
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int L, B, A, C, D;
int x, y, ans;
cin >> L >> A >> B >> C >> D;
x = B / D;
y = A / C;
if ((B % D) != 0)
x += 1;
if ((A % C) != 0)
y += 1;
if (x > y)
ans = L - x;
else
ans = L - y;
cout << ans;
return 0;
}
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int burger[3];
int drink[2];
int result = 0;
cin >> burger[0] >> burger[1] >> burger[2];
cin >> drink[0] >> drink[1];
sort(burger, burger + 3);
sort(drink, drink + 2);
result = burger[0] + drink[0] - 50;
cout << result;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int arr[2][3];
int worktime[3];
for (int i = 0; i < 3; i++)
{
cin >> arr[0][0] >> arr[0][1] >> arr[0][2];
cin >> arr[1][0] >> arr[1][1] >> arr[1][2];
if (arr[1][2] >= arr[0][2])
{
worktime[2] = arr[1][2] - arr[0][2];
}
else
{
arr[1][1] -= 1;
arr[1][2] += 60;
worktime[2] = arr[1][2] - arr[0][2];
}
if (arr[1][1] >= arr[0][1])
{
worktime[1] = arr[1][1] - arr[0][1];
}
else
{
arr[1][0] -= 1;
arr[1][1] += 60;
worktime[1] = arr[1][1] - arr[0][1];
}
worktime[0] = arr[1][0] - arr[0][0];
cout << worktime[0] << " " << worktime[1] << " " << worktime[2] << "\n";
}
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int minkook[4];
int manse[4];
int sum_minkook, sum_manse, max;
cin >> minkook[0] >> minkook[1] >> minkook[2] >> minkook[3];
cin >> manse[0] >> manse[1] >> manse[2] >> manse[3];
sum_minkook = minkook[0] + minkook[1] + minkook[2] + minkook[3];
sum_manse = manse[0] + manse[1] + manse[2] + manse[3];
if (sum_minkook >= sum_manse)
cout << sum_minkook;
else
cout << sum_manse;
return 0;
}