#P5355. [Ynoi Easy Round 2017] 由乃的玉米田

[Ynoi Easy Round 2017] 由乃的玉米田

Background

Problem Description

Yuno is taking a walk by her farmland. She suddenly finds that a row of corn in the field looks very ugly.

There are a total of NN corn plants in this row, and their heights are uneven.

Yuno thinks the cornfield is not beautiful, so she decides to make a data structure problem.

The problem is as follows:

You are given a sequence aa of length nn, with mm operations. Each operation queries whether, in a given interval, you can pick two numbers whose difference is xx, or queries whether, in a given interval, you can pick two numbers whose sum is xx, or queries whether, in a given interval, you can pick two numbers whose product is xx, or queries whether, in a given interval, you can pick two numbers whose quotient is xx (with no remainder). These four operations are numbered 1,2,3,41,2,3,4, respectively.

The two chosen numbers may come from the same position.

Input Format

The first line contains two integers n,mn,m.

The next line contains nn integers representing aia_i.

The next mm lines each contain four integers opt,l,r,xopt,l,r,x.

optopt indicates which type of operation it is, l,rl,r specify the interval of the operation, and xx is the value xx for this operation.

Output Format

For each query, if it is possible, output yuno; otherwise output yumi.

5 5
1 1 2 3 4
4 1 1 1
1 1 2 2
3 1 1 1
3 5 5 16
1 2 3 4
yuno
yumi
yuno
yuno
yumi

Hint

Idea: nzhtl1477, Solution: nzhtl1477, Code: nzhtl1477, Data: nzhtl1477&mrsrz.

For 100%100\% of the testdata, all input numbers are within [0,105][0,10^5], and the elements in the sequence are within [1,105][1,10^5].

Translated by ChatGPT 5