MOMOS  FEASTOFPIGS
The pig's are having a feast tonight!! There are N momos numbered from 0 to N1. They are all arranged in a row on a table. Also K pigs are attending the feast. The j^{th}pig has hunger a[j]. A pig with hunger a[j] only eats all momos with number i such that when i is divided by a[j], the remainder is 0. For example, if there are 20 momos and a pig has hunger 3, then the pig will eat momos at position 0,3,6,9,12,15,18. Once a momo at a particular position is eaten by one pig, it cannot be eaten by a different pig.
You're task is simple, given the number of momos, and hunger of K pigs, find the total number of momos left after the feast.
Input
The first line of the input contains two integers N and K, where N is the number of momos and K is the number of pigs. Lines 2,3,...,K+1 describe the hunger of K pigs. Line i+1 (1 ≤ i ≤ K) contains a single integer representing the hunger of the i^{th} pig(i.e. a[i]).
It is guaranteed that:
Either (1 ≤ N ≤ 10^{6} and 1 ≤ K ≤ 100) or (1≤ N ≤ 10^{14} and 1 ≤ K ≤ 20)
The hunger of every pig lies between 1 and N.
Output
A line containing a single integer, which is the number of momos left on the table after all pigs have finished eating.
Example
Input: 20 3 3 6 5 Output: 11
hide comments
nadstratosfer:
20210615 00:36:46
Good idea having 2 kinds of testfiles, however TL is probably unbeatable for slower languages; my PyPy solution needs about 1.55s for a worstcase file.

Added by:  Salil 
Date:  20200413 
Time limit:  2s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All 
Resource:  Inspired from IARCS judge problems 