QOJ.ac

QOJ

Time Limit: 3 s Memory Limit: 512 MB Total points: 100

#6179. 最大平方问题

统计

给定一个一元二次函数 $f(x) = ax^2 + bx+c$。对于满足 $1 \leq i \leq n$ 的 $n$ 个正整数 $i$,相应的二次函数值分别为 $f(1), f(2), \cdots, f(n)$。在通常情况下,它们的乘积 $\displaystyle \prod_{i=1}^n f(i)$ 不是一个平方数。能整除这个乘积的最大平方数是多少呢?

最大平方数问题:对于给定的一元二次函数 $f(x) = ax^2 + bx + c$,计算出能整除 $\displaystyle \prod_{i=1}^n f(i)$ 的最大平方数。

输入格式

输入的第一行有四个整数 $a, b, c, n,$,分别表示给定的一元二次函数 $f(x)=ax^2+bx+c$ 的相应系数为 $a,b,c$,以及乘积的项数为 $n$。

输出格式

输出能整除 $\prod_{i=1}^n f(i)$ 的最大平方数,对 $998\,244\,353$ 取模的结果。

样例数据

样例输入

1 2 3 4

样例输出

2916

子任务

测试数据中 $100\%$ 的数据满足 $1 \leq a,n \leq 2 \times 10^5$,$0 \leq b, c \leq 2 \times 10^5$ 。

About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.