All submissions for this problem are available.WW3 is near and Gru wants to recruit minions for his team. Gru went to the planet of minions to recruit minions, he saw that there are two villages separated by a river. He cannot recruit minions from both villages because then his team will have internal conflicts. Gru is now in a dilemma about which village to recruit as he wants to have the strongest possible team. You are given coordinates of houses on the planet. Each house has exactly one minion and his power is given. The planet of minion is considered as a 2-D plane and the river is denoted by a straight line ( $y=mx+c$ ). $Note:$ None of the houses are situated on the river. ###Input: - First-line will contain $N$, number of houses. - Second-line will contain two integers, $m$ and $c$ denoting the river. - Next $N$ lines will have exactly 3 integers $X[i], Y[i], P[i]$ denoting the coordinates of houses and the power of minion in that house ###Output: - Print the maximum power of the team which Gru can recruit. ###Constraints - $1 \leq N \leq 10^5$ - $-10^4 \leq m,c \leq 10^4$ - $-10^4 \leq X[i], Y[i] \leq 10^4$ - $ 1 \leq P[i] \leq 10^4$ ###Sample Input: 3 1 0 0 5 5 0 6 5 0 -8 20 ###Sample Output: 20
|Tags||maths, plit2020, priyam2k|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.