#include #include #include using namespace std; using ll = long long; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int t; cin>>t; while(t--){ ll m; cin>>m; vector d(10,0); for(int i = 1;i<=9;i++) cin>>d[i]; ll now = 0; for(int i = 1;i<=9;i++){ for(int j = 0;j