{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\n \u003cbr\u003e\n \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.\n \u003cbr\u003e\n \u003cbr\u003eBeing his advisor, you need to determine whether it\u0027s possible for your team to finish first in its division or not.\n \u003cbr\u003e\n \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.\n \u003cbr\u003e\n \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.\n "}},{"title":"Input","value":{"format":"HTML","content":"The first line of input contains \n \u003ci\u003eN\u003c/i\u003e (2 ≤ \n \u003ci\u003eN\u003c/i\u003e ≤ 20)\u0026nbsp;— the number of teams in your division. They are numbered from 1 to \n \u003ci\u003eN\u003c/i\u003e, your team has number 1.\n \u003cbr\u003e\n \u003cbr\u003eThe second line of input contains \n \u003ci\u003eN\u003c/i\u003e integers \n \u003ci\u003ew\u003c/i\u003e\n \u003csub\u003e1\u003c/sub\u003e, \n \u003ci\u003ew\u003c/i\u003e\n \u003csub\u003e2\u003c/sub\u003e,..., \n \u003ci\u003ew\u003c/i\u003e\n \u003csub\u003e\u003ci\u003eN\u003c/i\u003e\u003c/sub\u003e, where \n \u003ci\u003ew\u003c/i\u003e\n \u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e is the total number of games that \n \u003ci\u003ei\u003c/i\u003e\n \u003csup\u003e\u003ci\u003eth\u003c/i\u003e\u003c/sup\u003e team has won to the moment.\n \u003cbr\u003e\n \u003cbr\u003eThe third line of input contains \n \u003ci\u003eN\u003c/i\u003e integers \n \u003ci\u003er\u003c/i\u003e\n \u003csub\u003e1\u003c/sub\u003e, \n \u003ci\u003er\u003c/i\u003e\n \u003csub\u003e2\u003c/sub\u003e,..., \n \u003ci\u003er\u003c/i\u003e\n \u003csub\u003e\u003ci\u003eN\u003c/i\u003e\u003c/sub\u003e, where \n \u003ci\u003er\u003c/i\u003e\n \u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e is the total number of remaining games for the \n \u003ci\u003ei\u003c/i\u003e\n \u003csup\u003e\u003ci\u003eth\u003c/i\u003e\u003c/sup\u003e team (including the games inside the division).\n \u003cbr\u003e\n \u003cbr\u003eThe next \n \u003ci\u003eN\u003c/i\u003e lines contain \n \u003ci\u003eN\u003c/i\u003e integers each. The \n \u003ci\u003ej\u003c/i\u003e\n \u003csup\u003e\u003ci\u003eth\u003c/i\u003e\u003c/sup\u003e integer in the \n \u003ci\u003ei\u003c/i\u003e\n \u003csup\u003e\u003ci\u003eth\u003c/i\u003e\u003c/sup\u003e line of those contains \n \u003ci\u003ea\u003c/i\u003e\n \u003csub\u003e\u003ci\u003eij\u003c/i\u003e\u003c/sub\u003e\u0026nbsp;— the number of games remaining between teams \n \u003ci\u003ei\u003c/i\u003e and \n \u003ci\u003ej\u003c/i\u003e. It is always true that \n \u003ci\u003ea\u003c/i\u003e\n \u003csub\u003e\u003ci\u003eij\u003c/i\u003e\u003c/sub\u003e\u003da\n \u003csub\u003e\u003ci\u003eji\u003c/i\u003e\u003c/sub\u003e and \n \u003ci\u003ea\u003c/i\u003e\n \u003csub\u003e\u003ci\u003eii\u003c/i\u003e\u003c/sub\u003e\u003d0, for all \n \u003ci\u003ei\u003c/i\u003e \n \u003ci\u003ea\u003c/i\u003e\n \u003csub\u003e\u003ci\u003ei\u003c/i\u003e1\u003c/sub\u003e + \n \u003ci\u003ea\u003c/i\u003e\n \u003csub\u003e\u003ci\u003ei\u003c/i\u003e2\u003c/sub\u003e +... + \n \u003ci\u003ea\u003c/i\u003e\n \u003csub\u003e\u003ci\u003eiN\u003c/i\u003e\u003c/sub\u003e ≤ \n \u003ci\u003er\u003c/i\u003e\n \u003csub\u003e\u003ci\u003ei\u003c/i\u003e\u003c/sub\u003e.\n \u003cbr\u003e\n \u003cbr\u003eAll the numbers in input are non-negative and don\u0027t exceed 10\\,000.\n "}},{"title":"Output","value":{"format":"HTML","content":"On the only line of output, print \"\n \u003cpre style\u003d\"display:inline;font-size:120%;\"\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 \"\n \u003cpre style\u003d\"display:inline;font-size:120%;\"\u003eNO\u003c/pre\u003e\" (without quotes) otherwise.\n "}},{"title":"Example","value":{"format":"HTML","content":" \n \u003ctable cellspacing\u003d\"0\" cellpadding\u003d\"4\" style\u003d\"border-collapse:collapse; border: 1px black solid;\"\u003e \n \u003ctbody\u003e\n \u003ctr\u003e \n \u003ctd width\u003d\"400\" valign\u003d\"top\" style\u003d\"border-collapse:collapse; border: 1px black solid;\"\u003e \u003cpre\u003esample input\u003c/pre\u003e \u003c/td\u003e \n \u003ctd width\u003d\"400\" valign\u003d\"top\" style\u003d\"border-collapse:collapse; border: 1px black solid;\"\u003e \u003cpre\u003esample output\u003c/pre\u003e \u003c/td\u003e \n \u003c/tr\u003e \n \u003ctr\u003e \n \u003ctd width\u003d\"400\" valign\u003d\"top\" style\u003d\"border-collapse:collapse; border: 1px black solid;\"\u003e \u003cpre\u003e\n3\n1 2 2\n1 1 1\n0 0 0\n0 0 0\n0 0 0\n\u003c/pre\u003e \u003c/td\u003e \n \u003ctd width\u003d\"400\" valign\u003d\"top\" style\u003d\"border-collapse:collapse; border: 1px black solid;\"\u003e \u003cpre\u003e\nYES\n\u003c/pre\u003e \u003c/td\u003e \n \u003c/tr\u003e \n \u003c/tbody\u003e\n \u003c/table\u003e\n \u003cbr\u003e \n \u003ctable cellspacing\u003d\"0\" cellpadding\u003d\"4\" style\u003d\"border-collapse:collapse; border: 1px black solid;\"\u003e \n \u003ctbody\u003e\n \u003ctr\u003e \n \u003ctd width\u003d\"400\" valign\u003d\"top\" style\u003d\"border-collapse:collapse; border: 1px black solid;\"\u003e \u003cpre\u003esample input\u003c/pre\u003e \u003c/td\u003e \n \u003ctd width\u003d\"400\" valign\u003d\"top\" style\u003d\"border-collapse:collapse; border: 1px black solid;\"\u003e \u003cpre\u003esample output\u003c/pre\u003e \u003c/td\u003e \n \u003c/tr\u003e \n \u003ctr\u003e \n \u003ctd width\u003d\"400\" valign\u003d\"top\" style\u003d\"border-collapse:collapse; border: 1px black solid;\"\u003e \u003cpre\u003e\n3\n1 2 2\n1 1 1\n0 0 0\n0 0 1\n0 1 0\n\u003c/pre\u003e \u003c/td\u003e \n \u003ctd width\u003d\"400\" valign\u003d\"top\" style\u003d\"border-collapse:collapse; border: 1px black solid;\"\u003e \u003cpre\u003e\nNO\n\u003c/pre\u003e \u003c/td\u003e \n \u003c/tr\u003e \n \u003c/tbody\u003e\n \u003c/table\u003e\n \u003cbr\u003e \n "}},{"title":"Translation","value":{"format":"HTML","content":"NBA某小组内有N支球队,小组内以及小组间已经进行了若干场比赛。现在给出这N支球队目前胜利的场数、还剩多少场没有比(包括小组内和小组间)以及小组内任意两支球队之间还剩多少场没有比,问能否合理安排剩下的所有比赛,使得球队1最后胜利的场数至少和小组内任何一支其他球队一样。(2 \u003c\u003d N \u003c\u003d 20, 0 \u003c\u003d x \u003c\u003d 10000, x表示其他任何输入)"}}]}