import java.util.*;
import java.lang.*;
import java.io.*;
class Ideone
{
{
Scanner in
= new Scanner
(System.
in);
double sum = 0;
double numerator = 1, denominator = 1;
int n = in.nextInt();
for (int i = 1; i <= n; i++) {
denominator = pow(i,i-1);
sum += (1.0*numerator)/denominator;
numerator*=i;
}
System.
out.
println("Сумма: " + sum
); System.
out.
println("Числитель: " + numerator
); System.
out.
println("Знаменатель: " + denominator
); }
public static double pow(double number, int power)
{
double answer = 1;
for (int i = 0; i < power; i++)
{
answer *= number;
}
return answer;
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBJZGVvbmUKewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CgkJU2Nhbm5lciBpbiA9IG5ldyBTY2FubmVyKFN5c3RlbS5pbik7CgkJUHJpbnRXcml0ZXIgb3V0ID0gbmV3IFByaW50V3JpdGVyKFN5c3RlbS5vdXQpOwoKCQlkb3VibGUgc3VtID0gMDsKCQlkb3VibGUgbnVtZXJhdG9yID0gMSwgZGVub21pbmF0b3IgPSAxOwoJCWludCBuID0gaW4ubmV4dEludCgpOwoKCQlmb3IgKGludCBpID0gMTsgaSA8PSBuOyBpKyspIHsKICAgICAgICAgICAgCQlkZW5vbWluYXRvciA9IHBvdyhpLGktMSk7CiAgICAgICAgICAgIAkJc3VtICs9ICgxLjAqbnVtZXJhdG9yKS9kZW5vbWluYXRvcjsKICAgICAgICAgICAgCQludW1lcmF0b3IqPWk7CiAgICAgICAgICAgIAl9CiAgICAgICAgICAgIAlTeXN0ZW0ub3V0LnByaW50bG4oItCh0YPQvNC80LA6ICIgKyBzdW0pOwoJCVN5c3RlbS5vdXQucHJpbnRsbigi0KfQuNGB0LvQuNGC0LXQu9GMOiAiICsgbnVtZXJhdG9yKTsKCQlTeXN0ZW0ub3V0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