{"raw_statement":[{"iden":"statement","content":"You are given $k$ sequences of integers. The length of the $i$\\-th sequence equals to $n_i$.\n\nYou have to choose exactly two sequences $i$ and $j$ ($i \\ne j$) such that you can remove exactly one element in each of them in such a way that the sum of the changed sequence $i$ (its length will be equal to $n_i - 1$) equals to the sum of the changed sequence $j$ (its length will be equal to $n_j - 1$).\n\nNote that it's **required** to remove exactly one element in each of the two chosen sequences.\n\nAssume that the sum of the empty (of the length equals $0$) sequence is $0$."},{"iden":"input","content":"The first line contains an integer $k$ ($2 \\le k \\le 2 \\cdot 10^5$) — the number of sequences.\n\nThen $k$ pairs of lines follow, each pair containing a sequence.\n\nThe first line in the $i$\\-th pair contains one integer $n_i$ ($1 \\le n_i &lt; 2 \\cdot 10^5$) — the length of the $i$\\-th sequence. The second line of the $i$\\-th pair contains a sequence of $n_i$ integers $a_{i, 1}, a_{i, 2}, \\dots, a_{i, n_i}$.\n\nThe elements of sequences are integer numbers from $-10^4$ to $10^4$.\n\nThe sum of lengths of all given sequences don't exceed $2 \\cdot 10^5$, i.e. $n_1 + n_2 + \\dots + n_k \\le 2 \\cdot 10^5$."},{"iden":"output","content":"If it is impossible to choose two sequences such that they satisfy given conditions, print \"_NO_\" (without quotes). Otherwise in the first line print \"_YES_\" (without quotes), in the second line — two integers $i$, $x$ ($1 \\le i \\le k, 1 \\le x \\le n_i$), in the third line — two integers $j$, $y$ ($1 \\le j \\le k, 1 \\le y \\le n_j$). It means that the sum of the elements of the $i$\\-th sequence without the element with index $x$ equals to the sum of the elements of the $j$\\-th sequence without the element with index $y$.\n\nTwo chosen sequences must be distinct, i.e. $i \\ne j$. You can print them in any order.\n\nIf there are multiple possible answers, print any of them."},{"iden":"examples","content":"Input\n\n2\n5\n2 3 1 3 2\n6\n1 1 2 2 2 1\n\nOutput\n\nYES\n2 6\n1 2\n\nInput\n\n3\n1\n5\n5\n1 1 1 1 1\n2\n2 3\n\nOutput\n\nNO\n\nInput\n\n4\n6\n2 2 2 2 2 2\n5\n2 2 2 2 2\n3\n2 2 2\n5\n2 2 2 2 2\n\nOutput\n\nYES\n2 2\n4 1"},{"iden":"note","content":"In the first example there are two sequences $[2, 3, 1, 3, 2]$ and $[1, 1, 2, 2, 2, 1]$. You can remove the second element from the first sequence to get $[2, 1, 3, 2]$ and you can remove the sixth element from the second sequence to get $[1, 1, 2, 2, 2]$. The sums of the both resulting sequences equal to $8$, i.e. the sums are equal."}],"translated_statement":[{"iden":"statement","content":"你被给予 $k$ 个整数序列。第 $i$ 个序列的长度为 $n_i$。\n\n你需要恰好选择两个序列 $i$ 和 $j$（$i \\ne j$），使得你可以从每个序列中恰好移除一个元素，从而使得修改后的序列 $i$（长度变为 $n_i - 1$）的和等于修改后的序列 $j$（长度变为 $n_j - 1$）的和。\n\n注意，必须从两个选中的序列中各恰好移除一个元素。\n\n假设空序列（长度为 $0$）的和为 $0$。\n\n第一行包含一个整数 $k$（$2 \\le k \\le 2 \\cdot 10^5$）——序列的数量。\n\n接下来有 $k$ 对行，每对包含一个序列。\n\n第 $i$ 对中的第一行包含一个整数 $n_i$（$1 \\le n_i < 2 \\cdot 10^5$）——第 $i$ 个序列的长度。第二行包含 $n_i$ 个整数 $a_{i,1}, a_{i,2}, \\dots, a_{i,n_i}$，构成该序列。\n\n序列中的元素为范围在 $-10^4$ 到 $10^4$ 之间的整数。\n\n所有给定序列的长度之和不超过 $2 \\cdot 10^5$，即 $n_1 + n_2 + \\dots + n_k \\le 2 \\cdot 10^5$。\n\n如果不可能选择两个满足条件的序列，请输出 \"_NO_\"（不含引号）。否则，第一行输出 \"_YES_\"（不含引号），第二行输出两个整数 $i$, $x$（$1 \\le i \\le k$, $1 \\le x \\le n_i$），第三行输出两个整数 $j$, $y$（$1 \\le j \\le k$, $1 \\le y \\le n_j$）。这表示从第 $i$ 个序列中移除下标为 $x$ 的元素后的元素和，等于从第 $j$ 个序列中移除下标为 $y$ 的元素后的元素和。\n\n两个选中的序列必须不同，即 $i \\ne j$。你可以按任意顺序输出它们。\n\n如果有多个可能的答案，输出任意一个即可。\n\n在第一个例子中，有两个序列 $[2, 3, 1, 3, 2]$ 和 $[1, 1, 2, 2, 2, 1]$。你可以从第一个序列中移除第二个元素得到 $[2, 1, 3, 2]$，从第二个序列中移除第六个元素得到 $[1, 1, 2, 2, 2]$。两个结果序列的和均为 $8$，即和相等。"},{"iden":"input","content":"第一行包含一个整数 $k$（$2 \\le k \\le 2 \\cdot 10^5$）——序列的数量。接下来有 $k$ 对行，每对包含一个序列。第 $i$ 对中的第一行包含一个整数 $n_i$（$1 \\le n_i < 2 \\cdot 10^5$）——第 $i$ 个序列的长度。第二行包含 $n_i$ 个整数 $a_{i,1}, a_{i,2}, \\dots, a_{i,n_i}$，构成该序列。序列中的元素为范围在 $-10^4$ 到 $10^4$ 之间的整数。所有给定序列的长度之和不超过 $2 \\cdot 10^5$，即 $n_1 + n_2 + \\dots + n_k \\le 2 \\cdot 10^5$。"},{"iden":"output","content":"如果不可能选择两个满足条件的序列，请输出 \"_NO_\"（不含引号）。否则，第一行输出 \"_YES_\"（不含引号），第二行输出两个整数 $i$, $x$（$1 \\le i \\le k$, $1 \\le x \\le n_i$），第三行输出两个整数 $j$, $y$（$1 \\le j \\le k$, $1 \\le y \\le n_j$）。这表示从第 $i$ 个序列中移除下标为 $x$ 的元素后的元素和，等于从第 $j$ 个序列中移除下标为 $y$ 的元素后的元素和。两个选中的序列必须不同，即 $i \\ne j$。你可以按任意顺序输出它们。如果有多个可能的答案，输出任意一个即可。"},{"iden":"examples","content":"输入\n2\n5\n2 3 1 3 2\n6\n1 1 2 2 2 1\n输出\nYES\n2 6\n1 2\n\n输入\n3\n1\n5\n5\n1 1 1 1 1\n2\n2 3\n输出\nNO\n\n输入\n4\n6\n2 2 2 2 2 2\n5\n2 2 2 2 2\n3\n2 2 2\n5\n2 2 2 2 2\n输出\nYES\n2 2\n4 1"},{"iden":"note","content":"在第一个例子中，有两个序列 $[2, 3, 1, 3, 2]$ 和 $[1, 1, 2, 2, 2, 1]$。你可以从第一个序列中移除第二个元素得到 $[2, 1, 3, 2]$，从第二个序列中移除第六个元素得到 $[1, 1, 2, 2, 2]$。两个结果序列的和均为 $8$，即和相等。"}],"sample_group":[],"show_order":[],"formal_statement":"Let $ S_i = \\sum_{m=1}^{n_i} a_{i,m} $ denote the sum of the $i$-th sequence.\n\nFor each sequence $i$, define the set of possible sums after removing exactly one element:\n$$\nT_i = \\left\\{ S_i - a_{i,m} \\mid 1 \\leq m \\leq n_i \\right\\}\n$$\n\nWe seek distinct indices $i \\ne j$ and indices $x \\in [1, n_i]$, $y \\in [1, n_j]$ such that:\n$$\nS_i - a_{i,x} = S_j - a_{j,y}\n$$\n\nEquivalently, we seek $i \\ne j$ such that $T_i \\cap T_j \\ne \\emptyset$.\n\n**Objective:**  \nFind such a pair $(i, x)$ and $(j, y)$, or determine that no such pair exists.\n\n---\n\n**Formal Statement:**\n\nGiven:\n- $k \\in \\mathbb{N}$, $2 \\leq k \\leq 2 \\cdot 10^5$\n- For each $i \\in \\{1, \\dots, k\\}$:\n  - $n_i \\in \\mathbb{N}$, $1 \\leq n_i < 2 \\cdot 10^5$\n  - Sequence $a_i = (a_{i,1}, a_{i,2}, \\dots, a_{i,n_i}) \\in \\mathbb{Z}^{n_i}$, with $|a_{i,m}| \\leq 10^4$\n  - $\\sum_{i=1}^k n_i \\leq 2 \\cdot 10^5$\n\nDefine:\n- $S_i = \\sum_{m=1}^{n_i} a_{i,m}$\n- $T_i = \\{ S_i - a_{i,m} \\mid m = 1, \\dots, n_i \\}$\n\n**Find:**  \nIndices $i, j \\in \\{1, \\dots, k\\}$, $i \\ne j$, and indices $x \\in \\{1, \\dots, n_i\\}$, $y \\in \\{1, \\dots, n_j\\}$ such that:\n$$\nS_i - a_{i,x} = S_j - a_{j,y}\n$$\n\nIf no such pair exists, output \"NO\".  \nOtherwise, output \"YES\", followed by $(i, x)$ and $(j, y)$.","simple_statement":null,"has_page_source":false}