#P15698. [2018 KAIST RUN Spring] Segmentation

[2018 KAIST RUN Spring] Segmentation

题目描述

ZOYI is developing a tool called Channel which offers a tool to talk with online users in the site. Recently, ZOYI introduced a RF (Recency / Frequency) Model to distinguish users who are using the Channel and decided to classify the users through following calculations.

:::align{center} :::

Figure: Distinguishing users in RF Channel. Horizontal axis represents Recency, while vertical axis represents Frequency.

$(0 < f_1 < f_2 < f_3 < f_4, 0 < r_1 < r_2 < r_3 < r_4, \text{all } f_i \text{ and } r_i \text{ are integers.})$

xx axis represents Recency and yy axis represents Frequency. All online users are given values rr, ff by their connection record, and are classified into one of twelve conditions shown below.

  • “New Customer”
  • “Promising”
  • “About to Sleep”
  • “Hibernating”
  • “Lost”
  • “Potential Loyalist”
  • “Need Attention”
  • “About to Leave”
  • “Champion”
  • “Loyal Customer”
  • “Can't Lose Them”
  • “None”

Among those, “None” means the user has no connection record to the server. If (r,f)(r, f) is located on two or more classification boundaries, it follows the classification of (r0.5,f0.5)(r - 0.5, f - 0.5). For example, if the value of (r,f)(r, f) is (r4,f2)(r_4, f_2) it is classified as “Hibernating”, while if the value is (r3,f4)(r_3, f_4), it is classified as “Loyal Customer”.

You want to investigate a user status of whom interested in RUN, so you are trying to install the program in the following way:

  • rr: if the current time is tt, t(most recent access time)t - \text{(most recent access time)}
  • ff: number of visited times

Given events of site users, make a program which classifies the users following the given picture above.

输入格式

First line contains four space-separated integers r1,r2,r3,r4r_1, r_2, r_3, r_4.

Second line consists four space-separated integers f1,f2,f3,f4f_1, f_2, f_3, f_4.

Third line contains a single integer NN.

Next NN lines contains events in time order, where iith element represents the event held at time ii.

Each event is given as space-separated AA and BB, where BB is the username which contains no whitespace with at most 10 alphabets. AA has a value of 1 or 2, where 1 means the user entered the site while 2 means you should print how the user is classified.

输出格式

For events which AA is 2, print how the user is classified in each line (without quotes).

1 2 3 4
1 2 3 4
8
1 RUN
1 Alex
2 Alex
1 RUN
1 RUN
1 Alex
2 Alex
2 RUN
New Customer
Potential Loyalist
Need Attention

提示

The connection status of Alex is f=1f = 1 (first visit), r=1r = 1 (time 32=13 - 2 = 1) at time 3. Thus, Alex is classified as “New Customer”.

At time 7, the connection status of Alex is f=2f = 2 (second visit), r=1r = 1 (time 76=17 - 6 = 1). Thus, Alex is classified as “Potential Loyalist”.

At time 8, the connection status of RUN is f=3f = 3 (third visit), r=3r = 3 (time 85=38 - 5 = 3). Thus, RUN is classified as “Need Attention”.

Constraints

  • 1N100,0001 \le N \le 100,000
  • 0<r1<r2<r3<r410,0000 < r_1 < r_2 < r_3 < r_4 \le 10,000
  • 0<f1<f2<f3<f410,0000 < f_1 < f_2 < f_3 < f_4 \le 10,000