题目描述
Problem Background
"In the field of information science education in middle schools, Luogu" is undoubtedly a very popular auxiliary website. More than a hundred schools are currently using Luogu for education in informatics olympiads (hereafter referred to as OI). Luogu is so popular because it innovatively moved almost every aspect of OI education online. Both school competition coaches and students can practice and enhance their abilities using just this one website."
—Excerpt from "Xiamen Primary and Secondary School Education Science Research," February 2015 issue.
Problem Description
Two coaches from the information group at XX Middle School are debating whether Luogu should be the primary training tool for the school's information group. They finally decide to use a quantitative method to determine whether to switch.
The original training method at the school involves using cena to load test data on the teacher's computer in the computer lab, which takes $T_a$ time for each problem. After students write their code, they can go to the teacher's computer to retrieve their programs for evaluation. However, due to the round trip, each evaluation wastes $T_b$ time. Therefore, students are also allowed to load test data on their own computers, which can be done at their discretion for each problem, taking the same time $T_a$, but reducing the evaluation time to $T_c$. Additionally, the school may use Excel to record the training progress of each student. If a student's score on a problem exceeds the record in the table, it will take $T_d$ time to update this score; otherwise, it is unnecessary. If the problem has not been submitted before, it is considered that the program in the table records a score of $0$.
On Luogu, one only needs to upload the problems and test data, which takes $T_a$ time. Each evaluation for students only takes $T_c$ time. Recording scores? That's Luogu's job, and it organizes the table for you immediately after submission, without any extra time.
It seems like a lot of time can be saved. However, coaches who support the traditional method argue that Luogu is not $100\%$ stable, and in some cases, it may not provide services. Therefore, the time spent on Luogu must be divided by its availability (a number less than $100\%$ represented as $A\%$) and rounded down. Also, due to traditional观念不易纠正, there is always distrust in handing over problem data to Luogu (kkksc03: blame me?). Therefore, the time spent on Luogu must also be increased by a penalty time $H$ for a fair comparison.
Given the training situation at the school, the coaches hope you can analyze for them which method to choose.
Input Format
The first line contains two integers $N, M$, representing the number of problems and the number of students, respectively.
The second line contains $N$ integers $P_1, P_2, \ldots, P_N$, representing the problem numbers involved.
The third line contains $M$ integers $S_1, S_2, \ldots, S_M$, representing the student IDs.
The fourth line contains seven integers $T_a, T_b, T_c, T_d, A, H, E$, where the meanings of the first six numbers are described in the problem statement. $E$ is $1$ if the scores are recorded in Excel, and $0$ if not.
The fifth line contains an integer $R$, representing the number of evaluations.
The next $R$ lines contain evaluation records, each line being $\mathit{Pr}_i, \mathit{Sr}_i, \mathit{Sc}_i$, representing the problem number, student ID, and score for that evaluation.
Output Format
Three lines.
The first line is the time spent using the traditional method.
The second line is the time spent using Luogu, including the penalty time.
The third line is the conclusion. If the time using Luogu is less than the time using the traditional method, output Use Luogu!. Otherwise, output Forget it....
Sample Input and Output
Input Sample #1
4 4
501 502 503 504
2 3 5 7
50 30 10 5 93 50 1
10
501 2 10
501 2 80
501 2 70
502 3 0
502 3 0
504 5 100
503 7 0
503 7 0
503 7 0
503 7 10
Output Sample #1
480
372
Use Luogu!
Input Sample #2
2 3
101 102
1 2 3
70 60 50 1 80 100 0
6
101 1 100
101 2 100
101 3 100
102 1 100
102 2 100
102 3 100
Output Sample #2
500
650
Forget it...
Notes/Hints
[Sample Explanation #1]
Using the traditional method, loading 4 problems takes $4 \times 50 = 200$. Students with IDs 2 and 7 using the teacher's computer would take $30 \times 3 = 90$ and $30 \times 4 = 120$ respectively, but clearly loading cena themselves only takes $50 + 10 \times 3 = 80$ and $50 + 10 \times 4 = 90$, which is more optimal. Students with IDs 3 and 5 would use the teacher's computer, taking $60$ and $30$ respectively. The first two evaluations by student 2 are monotonically increasing, so an additional $2 \times 5 = 10$ time is spent recording. Student 3 scores all zeros, so there's no need to record. Students 5 and 7 each spend $5$ time. Therefore, the total time spent is $200 + 80 + 90 + 60 + 30 + 10 + 5 + 5 = 480$.
Using Luogu, loading problems takes $200$, and 10 evaluations take $10 \times 10 = 100$. Considering stability, the time is $(200 + 100) / 93\% = 322$, so the final total time is $322 + 50 = 372$. Therefore, it is decided to use Luogu.
[Data Range]
For $50\%$ of the data, no Excel recording of scores is required.
For $50\%$ of the data, problem numbers and student IDs are both greater than or equal to $0$ and less than or equal to $1000$.
(These two cases may overlap)
For $100\%$ of the data, it is guaranteed that $1 \le n, m \le 1000$, $1 \le T_a, T_b, T_c, T_d, H \le 10000$, $1 \le R < 100000$, $0 \le \mathit{Sc}_i \le 100$, $1 \le A \le 100$, and student IDs and problem numbers are within $10^8$.
In fact, according to the certificate issued by Super Monitoring, Luogu's reliability (SLA) for the first quarter of 2015 was $99.36\%$. Also, traditional观念也是可以改变的.
The advantages of Luogu are many and cannot be quantified. The essence lies in the community. Isn't it great to learn and exchange with OIers across the country?
Finally, a word: The notice from last year's "Squeeze kkksc03" is still in effect, for details.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分