問題一覧 > 通常問題

No.1567 Integer Coefficient Equation

レベル : / AI推定難易度 : 1925 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 21
作問者 : PCTprobability / テスター : blackyuki
お気に入りにしたユーザー ProblemId : 6288 / 自分の提出
問題文最終更新日: 2021-06-26 15:18:34
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
灘校文化祭コンテスト 2021 day1 (順位表) の他の問題:

Problem Statement

Find the number of integers $k$ between $L$ and $R$, inclusive, that satisfy the following condition. (13:34 Corrected from "positive integer" to "integer")

  • There exists a polynomial $f(x)$ with integer coefficients such that the equation $f(x) = P$ has at least $5$ distinct integer solutions and $f(x) = k$ has an integer solution.

You are given $T$ test cases; find the answer for each of them.

Input

$T$
$P_1 \quad L_1 \quad R_1$
$P_2 \quad L_2 \quad R_2 $
$\vdots$
$P_T \quad L_T \quad R_T$

  • All inputs are integers.
  • $1 \le T \le 10^5$
  • $|P_i,L_i,R_i| \le 2 \times 10^5$
  • $L_i \le R_i$

Output

Output $T$ lines. On the $i(1 \le i \le T)$-th line, output the answer for the $i$-th test case.

Sample

Sample 1
Input
1
13 69 70
Output
1

An example of a polynomial $f(x)$ with integer coefficients such that $f(x)=13$ has at least $5$ distinct integer solutions and $f(x)=69$ has an integer solution is $2 x^5 - 16 x^4 + 2 x^3 + 236 x^2 - 544 x + 333 $.

It can also be proved that there is no polynomial $f(x)$ with integer coefficients such that $f(x)=13$ has at least $5$ distinct integer solutions and $f(x)=70$ has an integer solution.

Therefore, the answer for this case is $1$.

Sample 2
Input
4
8 17 28
-101 -164 -139
-217 -78 -8
9 -110 -59
Output
4
11
35
25

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。