BERNULLI - Bernoulli numbers
Your task is to compute natural logarithm of the absolute value of the Bernoulli number for many integer parameters N.
I/O format is the same as in BINARYIO.
Array of unsigned 32 bit integers in binary format (use fread in C/C++)
To read unsigned N use fread(&N, sizeof(N), 1, stdin) instead of usual scanf("%u", &N) until the end of file.
For each test case 2 ≤ N < 232, N is even. There will be up to 1,250,000 numbers in input file.
To write double a use fwrite(&a, sizeof(a), 1, stdout) instead of usual printf("%lf\n", a).
For each N output ln(|BN|) with absolute or relative error less than 10-15
Sample input and output are readable for your convenience!!!
TL = 5 * My time
@mikhaelkh is the idea of using the Bernouli_N approximation by 2*N!/(2*Pi)^N starting any N correct?
I will leave a hint for followers: Bernoulli numbers, that are less than 1 produce the biggest error... and there are not too many of them.Last edit: 2018-11-01 19:57:39
judge => http://www.spoj.com/files/judge/12890/