{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cbr\u003eBreaking news! A Russian billionaire has bought a yet undisclosed NBA team. He\u0027s planning to invest huge effort and money into making that team the best. And in fact he\u0027s been very specific about the expected result: the first place.\u003cbr\u003eBeing his advisor, you need to determine whether it\u0027s possible for your team to finish first in its division or not.\u003cbr\u003eMore formally, the NBA regular season is organized as follows: all teams play some games, in each game one team wins and one team loses. Teams are grouped into divisions, some games are between the teams in the same division, and some are between the teams in different divisions.\u003cbr\u003eGiven the current score and the total number of remaining games for each team of your division, and the number of remaining games between each pair of teams in your division, determine if it\u0027s possible for your team to score at least as much wins as any other team in your division.\u003cbr\u003e\u003cdiv align\u003d\"left\" style\u003d\"margin-top: 1.0em;\"\u003e\u003cb\u003eInput\u003c/b\u003e\u003c/div\u003eThe first line of input contains \u003ci\u003eN\u003c/i\u003e (2 ≤ \u003ci\u003eN\u003c/i\u003e ≤ 20)\u0026nbsp;— the number of teams in your division. They are numbered from 1 to \u003ci\u003eN\u003c/i\u003e, your team has number 1.\u003cbr\u003eThe second line of input contains \u003ci\u003eN\u003c/i\u003e integers \u003ci\u003ew\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e, \u003ci\u003ew\u003c/i\u003e\u003csub\u003e2\u003c/sub\u003e,..., \u003ci\u003ew\u003c/i\u003e\u003csub\u003e\u003ci\u003eN\u003c/i\u003e\u003c/sub\u003e, where \u003ci\u003ew\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e is the total number of games that \u003ci\u003ei\u003c/i\u003e\u003csup\u003e\u003ci\u003eth\u003c/i\u003e\u003c/sup\u003e team has won to the moment.\u003cbr\u003eThe third line of input contains \u003ci\u003eN\u003c/i\u003e integers \u003ci\u003er\u003c/i\u003e\u003csub\u003e1\u003c/sub\u003e, \u003ci\u003er\u003c/i\u003e\u003csub\u003e2\u003c/sub\u003e,..., \u003ci\u003er\u003c/i\u003e\u003csub\u003e\u003ci\u003eN\u003c/i\u003e\u003c/sub\u003e, where \u003ci\u003er\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e is the total number of remaining games for the \u003ci\u003ei\u003c/i\u003e\u003csup\u003e\u003ci\u003eth\u003c/i\u003e\u003c/sup\u003e team (including the games inside the division).\u003cbr\u003eThe next \u003ci\u003eN\u003c/i\u003e lines contain \u003ci\u003eN\u003c/i\u003e integers each. The \u003ci\u003ej\u003c/i\u003e\u003csup\u003e\u003ci\u003eth\u003c/i\u003e\u003c/sup\u003e integer in the \u003ci\u003ei\u003c/i\u003e\u003csup\u003e\u003ci\u003eth\u003c/i\u003e\u003c/sup\u003e line of those contains \u003ci\u003ea\u003c/i\u003e\u003csub\u003e\u003ci\u003eij\u003c/i\u003e\u003c/sub\u003e\u0026nbsp;— the number of games remaining between teams \u003ci\u003ei\u003c/i\u003e and \u003ci\u003ej\u003c/i\u003e. It is always true that \u003ci\u003ea\u003c/i\u003e\u003csub\u003e\u003ci\u003eij\u003c/i\u003e\u003c/sub\u003e\u003da\u003csub\u003e\u003ci\u003eji\u003c/i\u003e\u003c/sub\u003e and \u003ci\u003ea\u003c/i\u003e\u003csub\u003e\u003ci\u003eii\u003c/i\u003e\u003c/sub\u003e\u003d0, for all \u003ci\u003ei\u003c/i\u003e \u003ci\u003ea\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e1\u003c/sub\u003e + \u003ci\u003ea\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e2\u003c/sub\u003e +... + \u003ci\u003ea\u003c/i\u003e\u003csub\u003e\u003ci\u003eiN\u003c/i\u003e\u003c/sub\u003e ≤ \u003ci\u003er\u003c/i\u003e\u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e.\u003cbr\u003eAll the numbers in input are non-negative and don\u0027t exceed 10\\,000.\u003cbr\u003e\u003cdiv align\u003d\"left\" style\u003d\"margin-top: 1.0em;\"\u003e\u003cb\u003eOutput\u003c/b\u003e\u003c/div\u003eOn the only line of output, print \"\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003eYES\u003c/pre\u003e\" (without quotes) if it\u0027s possible for the team 1 to score at least as much wins as any other team of its division, and \"\u003cpre style\u003d\"display: inline;font-size: 120.0%;\"\u003eNO\u003c/pre\u003e\" (without quotes) otherwise.\u003cbr\u003e"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\n1 2 2\n1 1 1\n0 0 0\n0 0 0\n0 0 0\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYES\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Sample 2","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\n1 2 2\n1 1 1\n0 0 0\n0 0 1\n0 1 0\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eNO\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}