编程介的小学生
2019-02-27 17:52C语言运用逻辑方式计算的这个密码的编码的问题怎么实现,运用C编程技术
Problem Description
Xiaoming has just come up with a new way for encryption, by calculating the key from a publicly viewable number in the following way:
Let the public key N = AB, where 1 <= A, B <= 1000000, and a0, a1, a2, …, ak-1 be the factors of N, then the private key M is calculated by summing the cube of number of factors of all ais. For example, if A is 2 and B is 3, then N = AB = 8, a0 = 1, a1 = 2, a2 = 4, a3 = 8, so the value of M is 1 + 8 + 27 + 64 = 100.
However, contrary to what Xiaoming believes, this encryption scheme is extremely vulnerable. Can you write a program to prove it?
Input
There are multiple test cases in the input file. Each test case starts with two integers A, and B. (1 <= A, B <= 1000000). Input ends with End-of-File.
Note: There are about 50000 test cases in the input file. Please optimize your algorithm to ensure that it can finish within the given time limit.
Output
For each test case, output the value of M (mod 10007) in the format as indicated in the sample output.
Sample Input
2 2
1 1
4 7
Sample Output
Case 1: 36
Case 2: 1
Case 3: 4393
- 点赞
- 回答
- 收藏
- 复制链接分享
0条回答
为你推荐
- C语言编程题目——实现排序
- c语言
- c++
- 2个回答
- 这是一个关于C语言求平年闰年的问题
- c语言
- 3个回答
- 这是一个C语言 的书写问题
- c语言
- 2个回答
- C语言输出图案问题,这个关系怎么找出来的
- c语言
- c++
- 1个回答
- 采用算法计算一个几何问题,计算围栏的长度怎么用C语言程序的实现的方式
- r语言
- Golang
- erlang
- 1个回答