QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 1024 MB Total points: 100

#21978. 类欧几里得算法

统计

题目描述

这是一道模板题。

给出 $T$ 组询问,每组用 $n, a, b, c, k_1, k_2$ 来描述。对于每组询问,请你求出

$$ \sum_{x = 0} ^ {n} x ^ {k_1} {\left \lfloor \frac{ax + b}{c} \right \rfloor} ^ {k_2} $$

对 $1000000007$ 取模。

输入格式

第一行读入一个数 $T$ 。

接下来 $T$ 行,每行读入六个数 $n, a, b, c, k_1, k_2$ 。

输出格式

输出共 $T$ 行,每行一个答案。

样例数据

样例输入

1
2 2 0 1 1 1

样例输出

10

子任务

对于 $100 \%$ 的数据,$T = 1000, 1 \le n, a, b, c \le {10} ^ 9, 0 \le k_1 + k_2 \le 10$ 。

测试点 $n$ $k_1, k_2$
$10\%$ $n \le 100000$ 无特殊限制
$20\%$ 无特殊限制 $k_1 = 0, k_2 = 1$
$20\%$ 无特殊限制 $k_1 + k_2 \le 2$
$50\%$ 无特殊限制 无特殊限制
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.