PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#QHD0000023. Khả năng chia hết (Divisibility)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Khả năng chia hết (Divisibility)

Divisibility

Source: UVa

Version: Phuoc Hung OJ Extended

Problem Statement

Given integers a1,a2,…,ana_1,a_2,\ldots,a_n in their original order, insert either + or - between each pair of consecutive values.

The first value a1a_1 is unchanged; numbers may not be reordered or altered. The resulting arithmetic expression is evaluated in order.

Determine whether some choice of operators makes its value divisible by kk. Print Divisible if possible, or Not divisible otherwise.

Input

The first line contains nn and kk.

The second line contains nn integers a1,a2,…,ana_1,a_2,\ldots,a_n in expression order.

Output

Print Divisible if an arrangement exists, or Not divisible otherwise.

Subtasks

  • Subtask 1 (20 points): 1≤n≤201\le n\le 20; 2≤k≤1002\le k\le 100; −10000≤ai≤10000-10000\le a_i\le 10000.
  • Subtask 2 (30 points): 1≤n≤4001\le n\le 400; 2≤k≤1002\le k\le 100; −10000≤ai≤10000-10000\le a_i\le 10000.
  • Subtask 3 (50 points): 1≤n≤100001\le n\le 10000; 2≤k≤1002\le k\le 100; −10000≤ai≤10000-10000\le a_i\le 10000.

Examples

Input

4 7
17 5 -21 15

Output

Divisible

Explanation

Choose 17+5−(−21)−15=2817+5-(-21)-15=28. Since 28=7×428=7\times4, the result is divisible by 77. Therefore the program prints Divisible.