#CCBCHBAHAI0000103. Bẫy sizeof khi array đi vào hàm

Bẫy sizeof khi array đi vào hàm

The sizeof Trap for Array Parameters

Source: Phuoc Hung OJ

Version: Phuoc Hung OJ Extended

Problem

Consider a real C array object declared at the caller as int a[N];, where NN is a positive compile-time constant in the conceptual program. For the expression sizeof(a) / sizeof(a[0]):

  • context 0: it is evaluated in the block where a is still an array object, so it yields NN;
  • context 1: it is evaluated inside a function parameter declared int a[]; that parameter is adjusted to int *, so sizeof(a) is the size of a pointer and the original array length cannot be portably recovered from this expression.

Answer each context query.

Input

The first line contains N,QN,Q. The second line contains QQ values from {0,1}\{0,1\}.

Output

For context 0 print NN; for context 1 print UNKNOWN, one answer per line.

Subtask

Subtask 1 (20 points): 1≤N,Q≤101\le N,Q\le10.

Subtask 2 (30 points): 1≤N≤10001\le N\le1000, 1≤Q≤1001\le Q\le100.

Subtask 3 (50 points): 1≤N≤1061\le N\le10^6, 1≤Q≤10001\le Q\le1000.

Example

Input

8 4
0 1 0 1

Output

8
UNKNOWN
8
UNKNOWN

Explanation

At the declaration site a is an array; as a function parameter it is adjusted to a pointer.