{"problem":{"name":"Subset Sum Gaps","description":{"content":"You are given a sequence of positive integers $A=(A_1,A_2,\\ldots,A_N)$. There are $2^N$ subsequences of $A$ when distinguishing subsequences by the indices of their elements. Let $S_1, S_2, \\ldots, S_","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc210_e"},"statements":[{"statement_type":"Markdown","content":"You are given a sequence of positive integers $A=(A_1,A_2,\\ldots,A_N)$.\nThere are $2^N$ subsequences of $A$ when distinguishing subsequences by the indices of their elements. Let $S_1, S_2, \\ldots, S_{2^N}$ be the sums of these subsequences, enumerated **in ascending order**.\nFor all integers $k$ ($1\\leq k\\leq 2^N-1$) that satisfy $1.01 \\times S_k\\leq S_{k+1}$, output $S_k, S_{k+1}, (k\\bmod 998244353)$.\nWhat is a subsequence A subsequence of a sequence $A$ is a sequence obtained by removing zero or more elements from $A$ and arranging the remaining elements in their original order.\n\n## Constraints\n\n*   $2\\leq N\\leq 5000$\n*   $1\\leq A_i\\leq 10^{13}$\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\ldots$ $A_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc210_e","tags":[],"sample_group":[["3\n5 5 3","5\n0 3 1\n3 5 2\n5 8 4\n8 10 6\n10 13 7\n\nWe have the following eight subsequences:\n\n*   The empty subsequence. The sum is $0$.\n*   $(5)$. The sum is $5$. This subsequence appears twice.\n*   $(3)$. The sum is $3$.\n*   $(5,5)$. The sum is $10$.\n*   $(5,3)$. The sum is $8$. This subsequence appears twice.\n*   $(5,5,3)$. The sum is $13$.\n\n$S_1, S_2, \\ldots, S_8$ are $0,3,5,5,8,8,10,13$ in order."],["2\n100 101","3\n0 100 1\n100 101 2\n101 201 3"],["2\n101 102","2\n0 101 1\n102 203 3"],["20\n456 206 448 830 937 793 483 527 772 239 361 925 364 956 355 420 557 739 323 912","23\n0 206 1\n206 239 2\n239 323 3\n323 355 4\n355 361 5\n364 420 7\n420 445 8\n448 456 10\n456 483 11\n483 527 12\n529 557 14\n570 594 19\n594 600 20\n603 626 22\n626 654 23\n662 678 26\n695 716 32\n725 733 36\n743 763 39\n784 793 48\n820 830 60\n850 865 65\n11397 11603 1048575"]],"created_at":"2026-03-03 11:01:14"}}