There is an positive integer $T(T \leq 10)$ in the first line for the number of testcases.(the number of testcases with $n>200$ is no more than $5$)
For each testcase, there are two integers in the first line $n(1 \leq n \leq 1000)$ and $t(1 \leq t \leq 3000)$ for the number of problems and the time limitation of this competition.
There are $n$ lines followed and three positive integers each line $A_i, B_i, C_i$. For the original mark,the mark decreasing per minute and the time dxy of solving this problem will spend.
Hint:
First to solve problem $2$ and then solve problem $1$ he will get $88$ marks. Higher than any other order.