题目描述
Problem Description
The fans of K-League professional football clubs are well-organized and disciplined cheerleaders, similar to the Red Devils (South Korea's cheerleading squad at the 2002 FIFA World Cup).
After many matches this season, the fans want to know if their supported team still has a chance to win the final league championship. In other words, whether the team can eventually achieve the highest points (most wins) through some specific match results, allowing for multiple teams to tie for first place.
Given $n$ teams, each team has won $w_i$ and lost $d_i$ matches. There are also some matches yet to be played, with $a_{ij}$ matches remaining between team $i$ and team $j$.
You need to identify all teams that could potentially win the championship.
All teams participate in the same number of matches, and for simplicity, you can assume there are no draws, i.e., the match results are either win or lose.
Input Format
The first line contains a positive integer $n$, representing the number of teams.
The second line contains $2n$ positive integers, representing $w_1, d_1, w_2, d_2, \cdots, w_n, d_n$.
The third line contains $n^2$ positive integers, representing $a_{11}, a_{12}, \cdots, a_{1n}, a_{21}, \cdots, a_{2n}, \cdots, a_{n1}, \cdots, a_{nn}$.
Output Format
Output a single line containing all teams that could potentially win the championship, in ascending order of their numbers, separated by spaces.
Sample Input and Output
Sample Input #1
3
2 0 1 1 0 2
0 2 2 2 0 2 2 2 0
Sample Output #1
1 2 3
Sample Input #2
3
4 0 2 2 0 4
0 1 1 1 0 1 1 1 0
Sample Output #2
1 2
Sample Input #3
4
0 3 3 1 1 3 3 0
0 0 0 2 0 0 1 0 0 1 0 0 2 0 0 0
Sample Output #3
2 4
Notes
For $100\%$ of the data, $n \le 25$, $w_i, d_i \le 100$, $a_{ij} \le 10$, $a_{ij} = a_{ji}$, and $a_{ii} = 0$.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分