UVa 10050 - Hartals

10050 - Hartals

 * http://acm.uva.es/p/v100/10050.html

Summary
Simulate the hartal strikes given the number of days, the number of political parties, and the hartal parameter of each party.

Explanation

 * Simulate each party and count the number of strikes over the number of days excluding friday and saturday.

Optimizations
For each party if h(i) is divisible by another h(j) discard that h(i).