QOJ.ac

QOJ

時間限制: 0.5 s 記憶體限制: 125 MB 總分: 100

#7475. NOIP2016 Peak of Life

统计

Given a sequence $a_1, a_2, \ldots, a_n$ of length $n$, where each number is between $0$ and $v - 1$, there are $m$ operations.

Operation 1: For a given range, determine if it is possible to choose two non-empty disjoint sets of indices $X$ and $Y$ such that:

  1. $X \cap Y = \emptyset$.
  2. Let the contribution of an element $i$ in set $X$ be $a_i + 1$. The sum of contributions of elements in set $X$ must equal the sum of contributions of elements in set $Y$. If such sets can be chosen, output Yuno, otherwise output Yuki.

Operation 2: Modify the numbers in a range $[l, r]$ such that for all $l \leq i \leq r$, $a_i = a_i^3 \bmod v$.

Input

The first line contains three integers $n, m, v$, as described above.

The next line contains $n$ integers, representing the sequence $a$.

The next $m$ lines each contain three integers $opt, l, r$, representing the operation type ($1$ or $2$) and the range $[l, r]$.

Output

For each query, output a single line containing the string Yuno or Yuki indicating whether the two sets can be chosen.

Examples

Input 1

20 20 152
3 26 133 54 79 81 72 109 66 91 82 100 35 23 104 17 51 114 12 58
2 1 17
2 6 12
1 1 12
2 3 5
2 11 11
2 7 19
2 6 15
1 5 12
1 1 9
1 10 19
2 3 19
2 6 20
2 1 13
2 1 15
2 1 9
1 1 1
2 1 7
2 7 19
2 6 19
2 3 6

Output 1

Yuno
Yuno
Yuno
Yuno
Yuki

Note

Idea: nzhtl1477, Solution: nzhtl1477, Code: nzhtl1477, Data: nzhtl1477

For $100\%$ of the data, $1 \leq n, m \leq 10^5$, $1 \leq v \leq 1000$. The data is not graded.

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.