B. LCM

B. LCM

time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

Ivan has number bb. He is sorting through the numbers aa from 11 to 10181018, and for every aa writes [a,b]a[a,b]a on blackboard. Here [a,b][a,b] stands for least common multiple of aa and bb. Ivan is very lazy, that's why this task bored him soon. But he is interested in how many different numbers he would write on the board if he would finish the task. Help him to find the quantity of different numbers he would write on the board.

Input

The only line contains one integer — bb (1≤b≤1010)(1≤b≤1010).

Output

Print one number — answer for the problem.

Examples

input

Copy

1

output

Copy

1

input

Copy

2

output

Copy

2

Note

In the first example [a,1]=a[a,1]=a, therefore [a,b]a[a,b]a is always equal to 11.

In the second example [a,2][a,2] can be equal to aa or 2⋅a2⋅a depending on parity of aa. [a,b]a[a,b]a can be equal to 11 and 22.

#include<iostream>
#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
    long long n,c;
   scanf("%lld",&n);
    c=0;
    for(long long int i=1; i*i<=n; i++)
    {
        if(n%i==0){c+=2;
        printf("%d\n",i);}
        if(i*i==n) c--;
    }
    printf("%lld\n",c);

}

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这段代码是一个简单的RSA加密示例。首先,它导入了一些必要的库,包括`Crypto.Util.number`、`gmpy2`和`random`。然后定义了一个函数`get_extend()`,它用于生成一个满足特定条件的随机数d。该函数使用`random.randint()`生成一个位于2680和2730之间的随机数d,并使用`isPrime()`检查该数是否为素数。如果是素数,它会使用`gmpy2.invert()`计算出与d互素的数e,并返回e。 接下来,代码定义了一个名为flag的字节串,将其转换为长整型m。然后设置了RSA加密所需的一些参数,包括指数e、两个随机生成的素数p和q、以及它们的最小公倍数lcm。最后,使用`pow()`函数对明文m进行加密,得到密文c。 另外,代码还生成了两个扩展指数e1和e2,并将所有参数打印出来。 所以,这道题的解题思路是通过阅读代码,了解RSA加密算法的基本原理和参数设置,并根据给定的参数计算出相应的结果。具体而言,需要注意以下几点: 1. 生成满足条件的随机数d:通过调用`get_extend()`函数生成满足条件的随机数d。 2. 计算扩展指数e:根据生成的随机数d和最小公倍数lcm,使用`gmpy2.invert()`计算出与d互素的数e。 3. 生成RSA加密所需的参数:随机生成两个素数p和q,计算它们的最小公倍数lcm,并计算n=p*q。 4. 加密明文m:使用`pow()`函数对明文m进行加密,得到密文c。 5. 打印结果:将生成的扩展指数e1和e2、密文c以及其他参数打印出来。 通过以上步骤,就可以得到解题所需的结果。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值