#K33827. Coding Challenge: Olivia vs Ethan
Coding Challenge: Olivia vs Ethan
Coding Challenge: Olivia vs Ethan
In this problem, you are given multiple test cases for a coding challenge between two competitors, Olivia and Ethan. In each round of the challenge, each competitor is awarded a base score, and a penalty is applied for errors. The round score is calculated using the formula (score = D - 5 \times P), where (D) is the base score and (P) is the number of errors. The total score for each competitor is the sum of the round scores across all rounds in a test case. Your task is to determine the winner for each test case: output "Olivia" if Olivia's total score is higher, "Ethan" if Ethan's total score is higher, or "Draw" if their total scores are equal.
inputFormat
The input begins with an integer (T) representing the number of test cases. For each test case, the first line contains an integer (N), the number of rounds in that test case. This is followed by (N) lines, each containing four space-separated integers: (D_i), (P_i), (D_j), and (P_j), where (D_i) and (P_i) denote Olivia's base score and penalty, and (D_j) and (P_j) denote Ethan's base score and penalty, respectively.
outputFormat
For each test case, output a single line containing the verdict: "Olivia" if Olivia wins, "Ethan" if Ethan wins, or "Draw" if both have equal scores.## sample
6
3
100 1 90 2
200 3 150 1
300 0 300 1
2
50 0 50 0
100 2 90 0
2
100 0 50 0
200 1 150 2
2
50 2 100 0
100 3 200 1
50
Olivia
Draw
Olivia
Ethan
Olivia
Ethan
</p>