CF1061C.Multiplicity

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

You are given an integer array a1,a2,,ana_1, a_2, \ldots, a_n .

The array bb is called to be a subsequence of aa if it is possible to remove some elements from aa to get bb .

Array b1,b2,,bkb_1, b_2, \ldots, b_k is called to be good if it is not empty and for every ii ( 1ik1 \le i \le k ) bib_i is divisible by ii .

Find the number of good subsequences in aa modulo 109+710^9 + 7 .

Two subsequences are considered different if index sets of numbers included in them are different. That is, the values ​of the elements ​do not matter in the comparison of subsequences. In particular, the array aa has exactly 2n12^n - 1 different subsequences (excluding an empty subsequence).

输入格式

The first line contains an integer nn ( 1n1000001 \le n \le 100\,000 ) — the length of the array aa .

The next line contains integers a1,a2,,ana_1, a_2, \ldots, a_n ( 1ai1061 \le a_i \le 10^6 ).

输出格式

Print exactly one integer — the number of good subsequences taken modulo 109+710^9 + 7 .

输入输出样例

  • 输入#1

    2
    1 2
    

    输出#1

    3
  • 输入#2

    5
    2 2 1 22 14
    

    输出#2

    13

说明/提示

In the first example, all three non-empty possible subsequences are good: {1}\{1\} , {1,2}\{1, 2\} , {2}\{2\}

In the second example, the possible good subsequences are: {2}\{2\} , {2,2}\{2, 2\} , {2,22}\{2, 22\} , {2,14}\{2, 14\} , {2}\{2\} , {2,22}\{2, 22\} , {2,14}\{2, 14\} , {1}\{1\} , {1,22}\{1, 22\} , {1,14}\{1, 14\} , {22}\{22\} , {22,14}\{22, 14\} , {14}\{14\} .

Note, that some subsequences are listed more than once, since they occur in the original array multiple times.

首页