Algebra

시간 제한5초메모리 제한1024 MB

요약
x^n + a x + b가 서로 다른 유리근을 정확히 k개 가지도록 하는 정수 쌍 (a,b)의 개수를 |a|,|b| ≤ m 범위에서 센다.
난이도

어려움10점 중 8점

유형
정수론, 수학, 조합론, 완전 탐색
정답자
아직 제출이 없습니다

문제

Given three integers nn, mm, kk, find the number of pairs (a,b)(a, b) where

  • ∣a∣,∣b∣≤m|a|, |b| \leq m,
  • a,b∈Za, b \in \mathbb{Z}, i.e., aa and bb are integers,
  • ∣S∣=k|S| = k where SS be the set of rational roots of the equation xn+a⋅x+b=0x^n + a \cdot x + b = 0, and ∣S∣|S| is the size of SS. In particular, there exists exactly kk distinct rational numbers xx which solve the last equation.

Note: xx is a rational number if and only if there exists two integers pp and qq (q≠0q \neq 0) where x=pqx = \frac{p}{q}.

입력

The input consists of several test cases terminated by end-of-file. For each test case,

The first line contains three integers nn, mm and kk.

출력

For each test case, output an integer which denotes the number of pairs.

제한

  • 1≤n,m,k≤5×1051 \leq n, m, k \leq 5 \times 10^5
  • In each input, the sum of mm does not exceed 5×1055 \times 10^5.

힌트

For the first test case, only the equation x2=0x^2=0 has one rational root.

For the second test case, each of the following 77 equations has two distinct rational roots.

  • x2−2x=0x^2-2x=0
  • x2−x=0x^2-x=0
  • x2−x−2=0x^2-x-2=0
  • x2−1=0x^2-1=0
  • x2+x=0x^2+x=0
  • x2+2x=0x^2+2x=0
  • x2+x−2=0x^2+x-2=0

예제1

  1. 예제 1

    입력
    2 1 1
    2 2 2
    3 3 3
    
    예상 출력
    1
    7
    1