#include using namespace std; using ll = long long; #define sl static inline const int maxm = 1e6+7,maxn=1e4+7; int n,m,k; struct R{ int u,v,w; inline bool operator<(const R&o)const{ return w vr(r+1,r+1+m); for(int i=1;i<=k;i++){ for(ll j=1;j>n>>m>>k; for(int i=1;i<=m;i++){ cin>>r[i].u>>r[i].v>>r[i].w; } for(int i=1;i<=k;i++){ cin>>c[i].w; for(int j=1;j<=n;j++){ cin>>c[i].cw[j]; } } if(checkA()){ return 0; } if(checkB()){ return 0; } }