Can you find it

TimeLimit:5000MS  MemoryLimit:65536KB
64-bit integer IO format:%I64d
未提交 | 登录后收藏
Problem Description

Given a prime number C(1 <= C <= 2 * 10^5), and three integers k1, b1, k2 (1 <= k1, k2, b1 <= 10^9). Please find all pairs (a, b) which satisfied the equation 1462194692037058450.jpg.

Input
There are multiple test cases (no more than 30). For each test, a single line contains four integers C, k1, b1, k2.
Output

First, please output "Case #k: ", k is the number of test case. See sample output for more detail.
Please output all pairs (a, b) in lexicographical order. (1 <= a, b < C). If there is not a pair (a, b), please output -1.

SampleInput
23 1 1 2
SampleOutput
Case #1:
1 22
Submit
题目统计信息详细
总AC数18
通过人数8
尝试人数10
总提交量44
AC率18.18%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: