Task
On his birthday, Trraian went on a trip. He arrived in the land of Factoria, where he received a gift from the wizard Factorios. The gift contained an array of numbers and a number . To prevent Factorios from taking back the array, Trraian was asked the following question: "How many subarrays of the array have the property that the product of the numbers in the subarray is divisible by the factorial of ?" Trraian really wants to keep the array but he doesn't know how to answer Factorios' question, so he is asking for your help to answer the question, and he will be very grateful.
Definitions: A subarray of an array is a sequence of numbers that appear in consecutive positions in . The factorial of a number is equal to and is denoted as .
Input data
The first line of the input file factoria.in
contains two natural numbers, and . The second line contains the natural numbers .
Output data
The first line of the output file factoria.out
will contain a single integer, the answer to Factorios' question.
Constraints and clarifications
- , for from to .
Example
factoria.in
6 4
3 8 24 48 5 7
factoria.out
16
Explanation
The subarrays are: , , , , , , , , , , , , , , ,