{"problem":{"name":"F. Game With Array","description":{"content":"Petya and Vasya are competing with each other in a new interesting game as they always do. At the beginning of the game Petya has to come up with an array of $N$ positive integers. Sum of all element","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10259F"},"statements":[{"statement_type":"Markdown","content":"Petya and Vasya are competing with each other in a new interesting game as they always do.\n\nAt the beginning of the game Petya has to come up with an array of $N$ positive integers. Sum of all elements in his array should be equal to $S$. Then Petya has to select an integer $K$ such that $0 <= K <= S$.\n\nIn order to win, Vasya has to find a non-empty subarray in Petya's array such that the sum of all selected elements equals to either $K$ or $S -K$. Otherwise Vasya loses.\n\nYou are given integers $N$ and $S$. You should determine if Petya can win, considering Vasya plays optimally. If Petya can win, help him to do that.\n\nThe first line contains two integers $N$ and $S$ ($1 <= N <= S <= 10^6$) — the required length of the array and the required sum of its elements.\n\nIf Petya can win, print \"_YES_\" (without quotes) in the first line. Then print Petya's array in the second line. The array should contain $N$ positive integers with sum equal to $S$. In the third line print $K$. If there are many correct answers, you can print any of them.\n\nIf Petya can't win, print \"_NO_\" (without quotes).\n\nYou can print each letter in any register (lowercase or uppercase).\n\n## Input\n\nThe first line contains two integers $N$ and $S$ ($1 <= N <= S <= 10^6$) — the required length of the array and the required sum of its elements.\n\n## Output\n\nIf Petya can win, print \"_YES_\" (without quotes) in the first line. Then print Petya's array in the second line. The array should contain $N$ positive integers with sum equal to $S$. In the third line print $K$. If there are many correct answers, you can print any of them.If Petya can't win, print \"_NO_\" (without quotes).You can print each letter in any register (lowercase or uppercase).\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ N, S \\in \\mathbb{Z} $ with $ 1 \\leq N < S \\leq 10^6 $.  \nLet $ A = (a_1, a_2, \\dots, a_N) $ be a sequence of positive integers such that $ \\sum_{i=1}^N a_i = S $.  \nLet $ K \\in \\mathbb{Z} $ satisfy $ 0 \\leq K \\leq S $.  \n\n**Constraints**  \n1. $ a_i \\geq 1 $ for all $ i \\in \\{1, \\dots, N\\} $.  \n2. $ \\sum_{i=1}^N a_i = S $.  \n3. $ 0 \\leq K \\leq S $.  \n\n**Objective**  \nDetermine whether there exists a sequence $ A $ and an integer $ K $ such that **no non-empty subarray** of $ A $ has sum equal to $ K $ or $ S - K $.  \nIf such $ A $ and $ K $ exist, output \"YES\", followed by $ A $ and $ K $; otherwise, output \"NO\".","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10259F","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}