{"raw_statement":[{"iden":"problem statement","content":"You are given $N$ distinct integer grid points $(X_i, Y_i) \\ (i = 1, 2, \\dots, N)$ in the plane, each of which has an integer score $P_i$. You can choose an arbitrary number of grid points among them under the following condition. Find the maximum value of the sum of the scores of chosen grid points.\n**Condition:** A grid point **dominated** by a **convex combination** of the chosen grid points must be chosen. That is, for each $k = 1, 2, \\dots, N$, if there exists a tuple $(\\lambda_1, \\lambda_2, \\dots, \\lambda_N)$ of $N$ **nonnegative** reals with the following conditions, then $(X_k, Y_k)$ is chosen:\n\n*   $\\lambda_i > 0 \\implies (X_i, Y_i)$ is chosen.\n*   $\\sum_{i=1}^N \\lambda_i = 1.$\n*   $\\sum_{i=1}^N \\lambda_i X_i \\geq X_k.$\n*   $\\sum_{i=1}^N \\lambda_i Y_i \\geq Y_k.$"},{"iden":"constraints","content":"*   $1 \\leq N \\leq 200$\n*   $1 \\leq X_i \\leq 10^9 \\ \\ (1 \\leq i \\leq N)$\n*   $1 \\leq Y_i \\leq 10^9 \\ \\ (1 \\leq i \\leq N)$\n*   $(X_i, Y_i) \\neq (X_j, Y_j) \\ \\ (i \\neq j)$\n*   $|P_i| \\leq 10^7 \\ \\ (1 \\leq i \\leq N)$"},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$X_1 \\ Y_1 \\ P_1$\n$X_2 \\ Y_2 \\ P_2$\n$\\vdots$\n$X_N \\ Y_N \\ P_N$"},{"iden":"sample input 1","content":"3\n1 4 2\n4 1 3\n2 2 -4"},{"iden":"sample output 1","content":"3\n\nIt is optimal to choose only $(X_2, Y_2) = (4, 1)$. If you choose $(X_1, Y_1) = (1, 4)$ in addition, then for example $\\lambda_1 = 0.4$ and $\\lambda_2 = 0.6$ satisfy\n\\\\\\[ \\\\lambda_1 + \\\\lambda_2 = 0.4 + 0.6 = 1\\\\\\\\\\[1mm\\] \\\\lambda_1 X_1 + \\\\lambda_2 X_2 = 0.4 \\\\times 1 + 0.6 \\\\times 4 = 2.8 \\\\geq 2 = X_3\\\\\\\\\\[1mm\\] \\\\lambda_1 Y_1 + \\\\lambda_2 Y_2 = 0.4 \\\\times 4 + 0.6 \\\\times 1 = 2.2 \\\\geq 2 = Y_3, \\\\\\]\nand hence $(X_3, Y_3) = (2, 2)$ must be chosen in addition, which decreases the sum of scores as a result."},{"iden":"sample input 2","content":"3\n1 4 2\n4 1 3\n2 2 -1"},{"iden":"sample output 2","content":"4\n\nIt is optimal to choose all the grid points."},{"iden":"sample input 3","content":"3\n1 4 2\n4 1 3\n1 1 -6"},{"iden":"sample output 3","content":"0\n\nIt is sometimes optimal to choose no grid point."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}