Company: Accenture Japan
Difficulty: medium
Class Score Calculation Problem Description Our school is running a number-crunching contest between homeroom classes. Every student writes down their favorite integer on a slip of paper. A class's score is defined as the largest number of times the product of every integer submitted by that class can be divided evenly by a given integer K. You teach class 1-1, which has N students, and the i-th student wrote down the value A i . Write a program that computes your class's score. Watch out for overflow while computing it. Input Rules The program will be executed as follows: ./myApp < Input.In This program will receive standard input in the following format: N K A1 ... AN Output Rules Please output the answer in the following format to standard output: ans Output the answer on the first line. Constraints 1 ≤ N ≤ 10^6 , integer 2 ≤ K ≤ 10^9 , integer 1 ≤ A i ≤ 10^9 , integer Examples Example 1: Input: 3 5 10 100 50 Output: 5 Explanation: Multiplying the three submitte