P26798 [AtCoder] Standing Sign
普及
题目描述

Problem Description

There are $ N $ standing signs.

The $ i $th standing sign is installed at time $ S_i $.

Additionally, an integer $ T $ is given, and every time the time becomes a multiple of $ T $, all the standing signs currently installed are removed.

You can visit Kyoto University at any real time to see the standing signs. To see all the signs at least once, determine the minimum number of visits required.

Input Format

The input is given from the standard input in the following format:

$ N $ $ S_1 $ $\cdots$ $ S_N $ $ T $

Output Format

Output the minimum number of visits to Kyoto University required to see all the standing signs at least once.

Sample Input and Output

Sample Input #1

3
1 2 5
3

Sample Output #1

2

Sample Input #2

5
1 1 1 1 1
2021

Sample Output #2

1

Sample Input #3

10
623690081 433933447 476190629 262703497 211047202 971407775 628894325 731963982 822804784 450968417
128512451

Sample Output #3

7

Notes/Hints

Constraints

  • $1 \leq N \leq 2 \times 10^5$
  • $1 \leq S_i \leq 10^9$
  • $2 \leq T \leq 10^9$
  • All inputs are integers
  • $ S_i $ is not a multiple of $ T $

Sample Explanation 1

If you visit Kyoto University at time $ 2.1 $ and time $ 5.1 $, the timeline would be as follows:
- The 1st sign is installed at time $ 1 $.
- The 2nd sign is installed at time $ 2 $.
- You visit Kyoto University at time $ 2.1 $ and see the 1st and 2nd signs.
- The 1st and 2nd signs are removed at time $ 3 $.
- The 3rd sign is installed at time $ 5 $.
- You visit Kyoto University at time $ 5.1 $ and see the 3rd sign.
- The 3rd sign is removed at time $ 6 $.

Sample Explanation 2

Multiple signs can be installed at the same time.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3 1 2 5 3
样例输出
2