当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2769:Disgruntled Judge

题目描述
Once upon a time, there was an nwerc judge with a tendency to create slightly too hard problems. As a result, his problems were never solved. As you can image, this made our judge somewhat frustrated. This year, this frustration has culminated, and he has decided that rather than spending a lot of time constructing a well-crafted problem, he will simply write some insanely hard problem statement and just generate some random input and output files. After all, why bother having proper test data if nobody is going to try the problem anyway?

Thus, the judge generates a testcase by simply letting the input be a random number, and letting the output be another random number. Formally, to generate the data set with T test cases, the judge generates 2T random numbers x1, ..., x2T between 0 and 10000, and then writes T, followed by the sequence x1, x3, x5, ..., x2T-1 to the input file, and the sequence x2, x4, x6, ..., x2T to the output file.

The random number generator the judge uses is quite simple. He picks three numbers x1, a, and b between 0 and 10000 (inclusive), and then for i from 2 to 2T lets xi = (a · xi-1 + b) mod 10001.

You may have thought that such a poorly designed problem would not be used in a contest of such high standards as nwerc. Well, you were wrong.
输入解释
On the first line one positive number: the number of testcases, at most 100. After that per testcase:

* One line containing an integer n (0 ≤ n ≤ 10000): an input testcase.

The input file is guaranteed to be generated by the process described above.
输出解释
Per testcase:

* One line with an integer giving the answer for the testcase.

If there is more than one output file consistent with the input file, any one of these is acceptable.
输入样例
3
17
822
3014
输出样例
9727
1918
4110
来自杭电HDUOJ的附加信息
Recommend lcy

该题目是Virtual Judge题目,来自 杭电HDUOJ

题目来源 NWERC 2008

源链接: HDU-2769

最后修改于 2020-10-25T22:56:35+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)