#include #include #include #include #include #include #include #include #include #include #define scnaf scanf #define cahr char #define bug puts("bugbugbug"); using namespace std; typedef long long ll; const int maxn=3005; int dp[2][maxn]; struct T { int a,b,c; bool operator < (const T &z) const{ return b*z.c>z.b*c; } }a[maxn]; int main() { int T_T; scanf("%d",&T_T); while(T_T--){ int n,t; scanf("%d%d",&n,&t); for(int i=0;i