|
@@ -0,0 +1,18 @@
|
|
|
+#include <bits/stdc++.h>
|
|
|
+
|
|
|
+using namespace std;
|
|
|
+
|
|
|
+void fout(double x, int scale = 6) {
|
|
|
+ cout << setiosflags(ios::fixed) << setprecision(scale) << x << endl;
|
|
|
+}
|
|
|
+
|
|
|
+int main(int argc, char const *argv[]) {
|
|
|
+ double U, D, H, slope, area, perimeter;
|
|
|
+ cin >> U >> D >> H;
|
|
|
+ area = (U + D) * H / 2;
|
|
|
+ slope = hypot((D - U) / 2, H);
|
|
|
+ perimeter = U + D + 2 * slope;
|
|
|
+ fout(area, 2);
|
|
|
+ fout(perimeter, 2);
|
|
|
+ return 0;
|
|
|
+}
|