A Math Contest P17 - Heatwaves

View as PDF

Submit solution

Points: 45
Time limit: 7.0s
Memory limit: 512M

Problem type

You are given an integer N > 2 and a function \chi : \mathbb Z \to \mathbb C such that

  1. \chi(n) = \chi(n+N);
  2. \chi(n) = 0 \iff \gcd(n,N) \ne 1;
  3. \chi(n)\chi(m) = \chi(nm);
  4. the nonzero values of \chi has period \varphi(N).

Consider the unique function L_\chi(s) : \mathbb C \to \mathbb C such that

  1. when \operatorname{Re}(s)>1, then L_\chi(s) = \sum_{n=1}^\infty \frac{\chi(n)}{n^s};
  2. L_\chi(s) is differentiable everywhere.


  1. L_\chi(s) for a given complex number s;
  2. a complex number s with a nonzero imaginary part such that L_\chi(s) = 0.
You are further informed that
  1. The conditions of the function \chi are equivalent to the conditions of \chi being a primitive Dirichlet character.
  2. L_\chi(s) is the analytic continuation of the Dirichlet L-function onto the complex plane.
  3. Zeta functions can be analytically continued to any portion of the complex plane given by \operatorname{Re}(s) > \sigma for real \sigma using the Euler-Maclaurin summation formula.
  4. If we let a = [\chi(-1)=-1], and \varepsilon_\chi = \frac{1}{i^a\sqrt{N}} \sum_{n=1}^N \chi(n) e^{2\pi in/N}, and \xi_\chi(s) = \left(\frac{N}{\pi}\right)^{(s+a)/2} \Gamma\left(\frac{s+a}{2}\right) L_\chi(s), then \xi_\chi(s) satisfies \xi_\chi(s) = \varepsilon_\chi \xi_{\bar\chi}(1-s).


2 < N \le 1\,000

0 \le \operatorname{Re}(s) \le 1 and |\operatorname{Im}(s)| \le 5

x \in \{0, 1\} and 0 \le y \le 2z \le 10^9 and 1 \le z

For the first question, the jury answer is precise to 10^{-50}, and the magnitude of the difference between your answer and the jury answer should be less than 10^{-12}.

For the second question, the checker is precise to 10^{-15}, and the magnitude of L_\chi(s) of your answer should be less than 10^{-9}.

Input Specification

The first line contains an integer, N.

The next N lines contain three nonnegative integers x, y, and z each, representing \chi(0), \chi(1), \dots, \chi(N-1) respectively. The three integers x, y, z correspond to xe^{yi\pi/z}.

The next line contains two real numbers, with at most 5 digits after the decimal point, representing the real and imaginary parts of s.

Output Specification

On the first line, output the real and imaginary parts for the first answer.

On the second line, output the real and imaginary parts for the second answer.

Sample Input

0 0 1
1 0 2
1 1 2
1 3 2
1 2 2
0.69 4.2069

Sample Output

1.5186663729999338699 -0.8641952653252008201
0.5000000000000000000 6.1835781954508539144

Explanation for Sample


There are no comments at the moment.