#P3674. 小清新人渣的本愿
小清新人渣的本愿
Description
The problem is as follows:
You are given a sequence of length , with operations. Each operation asks whether, in a given interval, you can choose two numbers whose difference equals , or two numbers whose sum equals , or two numbers whose product equals . These three operations correspond to operations , respectively.
The two chosen numbers may come from the same position.

Input Format
The first line contains two numbers .
The second line contains numbers representing .
Each of the next lines contains four numbers opt l r x.
indicates which operation it is, specify the interval, and is the value for this operation.
Output Format
For each query, if it is possible, output hana; otherwise, output bi.
10 10
1 1 8 9 9 1 1 1 1 9
3 5 9 42
2 1 3 14
2 3 5 2
2 3 3 6
1 6 10 18
3 4 9 14
2 1 4 22
3 1 3 32
2 5 6 32
3 1 9 17
bi
bi
bi
bi
bi
bi
bi
bi
bi
bi
5 5
1 1 2 3 4
2 1 1 2
1 1 2 2
3 1 1 1
3 5 5 16
1 2 3 4
hana
bi
hana
hana
bi
Hint
Define as the maximum of each and all . Assume and each .
For of the testdata, .
For another of the testdata, .
For another of the testdata, only operation appears.
For another of the testdata, only operation appears.
For another of the testdata, only operation appears.
For of the testdata, .

Translated by ChatGPT 5
京公网安备 11011102002149号