QOJ.ac

QOJ

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

#21978. 类欧几里得算法

Statistics

题目描述

这是一道模板题。

给出 $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\%$ 无特殊限制 无特殊限制

Discussions

About Discussions

The discussion section is only for posting: Editorials, General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues. Submitting multiple issues may cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.