#include using namespace std; #define ll long long const int N = 105, M = 12, K = 20005; int T, n; bool g[K]; vector f[N][M]; int main() { scanf("%d", &T); while(T--){ scanf("%d", &n); for(int i=1; i<=n; ++i){ int x, y, z; scanf("%d", &x); for(int j=0; j