{"problem":{"name":"n-Way Tie","description":{"content":"In the country of Tieland, there is an annual tie tying tournament that hosts n participants numbered with integers from 1 to n. Each two participants meet exactly once and have a match in tie tying. ","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10074K"},"statements":[{"statement_type":"Markdown","content":"In the country of Tieland, there is an annual tie tying tournament that hosts n participants numbered with integers from 1 to n. Each two participants meet exactly once and have a match in tie tying. There is a winner and a loser in each of the matches. A participant obtains a point for each match victory, and the loser gets zero points for that match. The score of the participant is the total number of points he earned.\n\nHowever, the jury is worried of the scenario in which all participants have exactly the same score; in other words, there is an n-way tie. In that case any participant would be both the winner and the loser of the competition, which is absurd! Alas, the jury is tied up with the organisation of the tournament; help them and find out whether such a situation might occur!\n\nThe single line of the input contains an integer n (1 ≤ n ≤ 1000), the number of participants.\n\nIf such a scenario is possible, output \"_Yes_\" in the first line. Then output n - 1 lines, the i-th containing n - i space-separated integers. The j-th number of the i-th line aij should denote the outcome of the match between participants with numbers i and i + j: \n\nIf such a scenario is not possible, output \"_No_\" in a single line.\n\n## Input\n\nThe single line of the input contains an integer n (1 ≤ n ≤ 1000), the number of participants.\n\n## Output\n\nIf such a scenario is possible, output \"_Yes_\" in the first line. Then output n - 1 lines, the i-th containing n - i space-separated integers. The j-th number of the i-th line aij should denote the outcome of the match between participants with numbers i and i + j:   aij = 1, if the i-th participant won the match;  aij = 0, if the (i + j)-th participant won the match.  If multiple solutions exists, output any of them.If such a scenario is not possible, output \"_No_\" in a single line.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ be the number of participants.  \nLet $ G = (V, E) $ be a complete directed graph with $ V = \\{1, 2, \\dots, n\\} $, where each directed edge $ i \\to j $ ($ i \\ne j $) represents a match with $ i $ defeating $ j $.  \n\n**Constraints**  \n1. $ 1 \\le n \\le 1000 $  \n2. Each pair $ (i, j) $ with $ i < j $ has exactly one directed edge: either $ i \\to j $ or $ j \\to i $.  \n3. The out-degree of each vertex $ i $ (i.e., number of wins) must be equal for all $ i \\in V $.  \n\n**Objective**  \nDetermine whether there exists a tournament orientation of $ K_n $ such that every vertex has out-degree $ \\frac{n-1}{2} $.  \n\nIf possible, output:  \n- \"Yes\"  \n- For each $ i \\in \\{1, \\dots, n-1\\} $, output $ n - i $ integers: for each $ j \\in \\{1, \\dots, n-i\\} $, output $ 1 $ if $ i $ beats $ i+j $, else $ 0 $.  \n\nIf not possible, output:  \n- \"No\"","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10074K","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}