#include using namespace std; using ll=long long; using ld= long double; using P=pair; using V=vector; #define rep(i,n) for(ll i=0;i f(60,V(25)),f1(60,V(25)),f2(60,V(25)); while(true){ for(int i=59;0> n; if(n==-1) return 0; rep(i,n){ int h,p,x; cin >> h >> p >> x; x--; f[59][x]=f1[59][x]=h; f2[59][x]=p; } cout << "S" << endl; int c=1; rep(i,60) if(c==1&&f[i][now]>0){ c=0; f[i][now]-=l/100; if(f[i][now]<=0){ l+=f2[i][now]; score+=f1[i][now]; f[i][now]=f1[i][now]=f2[i][now]=0; } } } cout << "score : " << score << endl; }