All submissions for this problem are available.### Read problem statements in [Hindi](http://www.codechef.com/download/translated/AUG19/hindi/MSNSADM1.pdf), [Bengali](http://www.codechef.com/download/translated/AUG19/bengali/MSNSADM1.pdf), [Mandarin Chinese](http://www.codechef.com/download/translated/AUG19/mandarin/MSNSADM1.pdf), [Russian](http://www.codechef.com/download/translated/AUG19/russian/MSNSADM1.pdf), and [Vietnamese](http://www.codechef.com/download/translated/AUG19/vietnamese/MSNSADM1.pdf) as well. A football competition has just finished. The players have been given points for scoring goals and points for committing fouls. Now, it is up to Alex to find the best player in the tournament. As a programmer, your job is to help Alex by telling him the highest number of points achieved by some player. You are given two sequences $A_1, A_2, \ldots, A_N$ and $B_1, B_2, \ldots, B_N$. For each valid $i$, player $i$ scored $A_i$ goals and committed $B_i$ fouls. For each goal, the player that scored it gets $20$ points, and for each foul, $10$ points are deducted from the player that committed it. However, if the resulting number of points of some player is negative, this player will be considered to have $0$ points instead. You need to calculate the total number of points gained by each player and tell Alex the maximum of these values. ### Input - The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows. - The first line of each test case contains a single integer $N$. - The second line contains $N$ space-separated integers $A_1, A_2, \ldots, A_N$. - The third line contains $N$ space-separated integers $B_1, B_2, \ldots, B_N$. ### Output For each test case, print a single line containing one integer ― the maximum number of points. ### Constraints - $1 \le T \le 100$ - $1 \le N \le 150$ - $0 \le A_i \le 50$ for each valid $i$ - $0 \le B_i \le 50$ for each valid $i$ ### Subtasks **Subtask #1 (30 points):** $1 \le N \le 2$ **Subtask #2 (70 points):** original constraints ### Example Input ``` 2 3 40 30 50 2 4 20 1 0 10 ``` ### Example Output ``` 800 0 ``` ### Explanation **Example case 1:** The first player gets $800$ points for scoring goals and has $20$ points deducted for fouls. Likewise, the second player gets $560$ points and the third player gets $800$ points. The third player is the one with the maximum number of points.
|Tags||array, aug19, cakewalk, leoshovo, looping, vijju123|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.