int n; cin >> n; while (n--) { int x, y; cin >> x >> y; vector<vector<int>> vis(x, vector<int>(y)); // 上面 // 1010101010.... for (int i = 0; i < y; i += 2) { vis[0][i] = 1; }
// 右边 for (int i = 2; i < x; i += 2) { vis[i][y - 1] = 1; }
// 下面 for (int i = y - 3; i >= 0; i -= 2) { vis[x - 1][i] = 1; }
// 左边 for (int i = x - 3; i >= 2; i -= 2) { vis[i][0] = 1; } for(int i=0;i<x;i++){ for(int j=0;j<y;j++){ cout<<vis[i][j]; } cout<<endl; } cout<<endl; } }
int step; cin >> step; while (step--) { int n; cin >> n; vector<int> me(n), you(n); for (int i = 0; i < n; i++) cin >> me[i]; for (int i = 0; i < n; i++) cin >> you[i]; sort(me.begin(), me.end(), [](int a, int b) { return a > b; }); sort(you.begin(), you.end(), [](int a, int b) { return a > b; }); for (int i = 1; i < me.size(); i++) { me[i] += me[i - 1]; } for (int i = 1; i < me.size(); i++) { you[i] += you[i - 1]; } int l = 0, r = n + 1; while (l < r) { int mid = (l + r) >> 1; int ksub = (mid + n) - (mid + n) / 4; int big = min(ksub, mid); int little = ksub - big; int meSum = big * 100 + (little == 0 ? 0 : me[little - 1]); int youSum = you[min(ksub - 1, n - 1)];
if (meSum >= youSum) { r = mid; } else { l = mid + 1; } } cout << l << endl; } }