UVa 10036

From Algorithmist

Jump to: navigation, search

Contents

[edit] 10036 - Divisibility

[edit] Summary

Write a program that will determine divisibility of sequence of integers.

[edit] Explanation

Dynamic Programming

[edit] Input

7
4 7
17 5 -21 15
4 5
17 5 -21 15
10 30
9 -97 3 5 -1 0 11 -46 19 17
10 97
9 -97 3 5 -1 0 11 -46 19 17
12 16
-11 7 -73 40 5 -2 66 21 -64 16 16 16
5 15
-1 -2 -3 -4 -5
5 9
-5 -4 2 -2 0

[edit] Output

Divisible
Not divisible
Divisible
Not divisible
Not divisible
Divisible
Divisible 
Personal tools