Is It Even?
Time limit1sMemory limit1024 MB
Given N integers and K, decide whether the product of the integers is divisible by 2^K, printing 1 or 0.
- Level
Easy3 of 10
- Topics
- Math, Implementation
- Solved
- No attempts yet
Problem
You are a leading programmer at CompanyTM. You are given integers and asked whether their product is even. You find a very elegant solution. Then your supervisor tells you the task has changed: now you must find out whether the product is divisible by , where is a given integer.
Input
The first line contains two integers and (, ). The next lines each contain one integer ().
Output
Print 1 if divides . Otherwise, print 0.