LCC/Moose '20 Contest 4 J4 - Tea

View as PDF

Submit solution

Points: 5 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

MCPT is selling MCP Tea! They want to determine their total revenue R if they set the price to P. It is also known that the quantity of products sold Q is related to the price P by the linear equation A \cdot Q + B \cdot P = C, where A, B, C are integers. In addition, MCPT knows that the revenue R for a price P is given by R(P) = P \cdot Q.

MCPT wishes to know for N different prices P_i whether the price belongs to the part of the demand curve that is elastic or inelastic. A price P_1 belongs to the inelastic part if there exists a P_2 such that P_2 > P_1 and R(P_2) > R(P_1), otherwise it is elastic. Can you help MCPT?

Input Specification

The first line will contain 4 integers N\ (1 \le N \le 10^5), A, B, C\ (0 \le A, B, C \le 10^5).

The next N lines will contain an integer P_i\ (0 \le P_i \le 10^5).

It is guaranteed that A and B will not BOTH be zero.

Output Specification

On each line output elastic or inelastic if price P_i belongs to the elastic or inelastic part of the curve.

Sample Input

4 1 1 5
1
2
3
4

Sample Output

inelastic
inelastic
elastic
elastic

Comments

There are no comments at the moment.