#include using namespace std; const int INF=1e9; using pii=pair; using tii=tuple; #define rep(i,n) for (int i=0;i<(int)(n);i++) #define all(v) v.begin(),v.end() template void chmin(T &a,T b){ if(a>b){ a=b; } } template void chmax(T &a,T b){ if(a h,p,x; void input_cin(){ cin >> n; if(n==-1) exit(0); h.assign(n,0); p.assign(n,0); x.assign(n,0); rep(i,n) cin >> h[i] >> p[i] >> x[i]; } }Input; struct solver{ struct shooter{ int j; int l; int s; }; struct enemy{ int fh; int h; int p; }; void solve(){ int score=0; shooter me={12,1,0}; vector> grid(H,vector(W,{0,0,0})); int to=-1; rep(t,1000){ for(int i=H-2;0<=i;i--){ rep(j,W){ grid[i+1][j]=grid[i][j]; grid[i][j]={0,0,0}; } } Input.input_cin(); rep(i,Input.n){ grid[0][Input.x[i]].fh=Input.h[i]; grid[0][Input.x[i]].h=Input.h[i]; grid[0][Input.x[i]].p=Input.p[i]; } if(1<=me.l){ if(to==-1){ double mx=0; int p=-1; rep(i,H){ rep(j,W){ if(0> p; } Solver.solve(); }