P7308 [COCI 2018/2019 #2] Preokret
Description
Suppose we are watching a future ball game. The two teams are Team A and Team B. We know both teams' scores and the exact time of each scoring event. Within one second, it is impossible for more than one scoring event to happen.
King James wants answers to two questions:
1. How many total points were scored in the first half? (The whole game lasts $4 \times 12$ minutes.).
2. How many lead changes happened? (A lead change is defined as when a team is behind, and then after scoring, its score becomes greater than the other team's score.).
Input Format
The first line contains a positive integer $A$, which is Team A's total number of scoring events.
The next $A$ lines each contain a positive integer $A_s$, which is the time of Team A's $s$-th score.
The next line contains a positive integer $B$, which is Team B's total number of scoring events.
The next $B$ lines each contain a positive integer $B_s$, which is the time of Team B's $s$-th score.
Output Format
Output two lines. Each line should contain the answer to the corresponding question in the statement.
Explanation/Hint
#### Explanation for Sample 2
|Score (A:B)|Time (seconds)|Half|Lead change happened|
| :----------: | :----------: | :----------: | :----------: |
|$1:0$|$15$|$1$|No.|
|$1:1$|$20$|$1$|No.|
|$1:2$|$25$|$1$|Yes (B).|
|$2:2$|$30$|$1$|No.|
|$3:2$|$35$|$1$|Yes (A).|
|$3:3$|$40$|$1$|No.|
|$3:4$|$45$|$1$|Yes (B).|
|$3:5$|$50$|$1$|No.|
|$4:5$|$55$|$1$|No.|
|$5:5$|$60$|$1$|No.|
|$6:5$|$2065$|$2$|Yes (A).|
|$6:6$|$2070$|$2$|No.|
|$6:7$|$2075$|$2$|Yes (B).|
#### Constraints
For $100\%$ of the testdata, $1 \le A,B \le 2879$, $1 \le A_s,B_s \le 2880$.
#### Scoring
In each test case, the first line is worth $2$ points and the second line is worth $3$ points, for a total of $5$ points per test case.
Scoring requires a Special Judge. See the attachment for details.
#### Notes
**This problem's score follows the original COCI setting, with a full score of $50$.**
**Translated from [COCI2018-2019](https://hsin.hr/coci/archive/2018_2019/) [CONTEST #2](https://hsin.hr/coci/archive/2018_2019/contest2_tasks.pdf) _T1 Preokret_.**
Translated by ChatGPT 5