CF900D.Unusual Sequences

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Count the number of distinct sequences a1,a2,...,ana_{1},a_{2},...,a_{n} ( 1<=ai1<=a_{i} ) consisting of positive integers such that gcd(a1,a2,...,an)=xgcd(a_{1},a_{2},...,a_{n})=x and . As this number could be large, print the answer modulo 109+710^{9}+7 .

gcdgcd here means the greatest common divisor.

输入格式

The only line contains two positive integers xx and yy ( 1<=x,y<=1091<=x,y<=10^{9} ).

输出格式

Print the number of such sequences modulo 109+710^{9}+7 .

输入输出样例

  • 输入#1

    3 9
    

    输出#1

    3
    
  • 输入#2

    5 8
    

    输出#2

    0
    

说明/提示

There are three suitable sequences in the first test: (3,3,3)(3,3,3) , (3,6)(3,6) , (6,3)(6,3) .

There are no suitable sequences in the second test.

首页